diff --git a/fish-rust/src/fish_indent.rs b/fish-rust/src/fish_indent.rs old mode 100644 new mode 100755 index 70d8ef2f6..664a8cade --- a/fish-rust/src/fish_indent.rs +++ b/fish-rust/src/fish_indent.rs @@ -10,7 +10,7 @@ use crate::ast::{ self, Ast, Category, Leaf, List, Node, NodeVisitor, SourceRangeList, Traversal, Type, }; -use crate::builtins::shared::STATUS_CMD_ERROR; +use crate::builtins::shared::{STATUS_CMD_ERROR, STATUS_CMD_OK}; use crate::common::{ str2wcstring, unescape_string, wcs2string, wcs2zstring, UnescapeFlags, UnescapeStringStyle, PROGRAM_NAME, @@ -787,15 +787,21 @@ enum OutputType { while let Some(c) = w.wgetopt_long() { match c { 'P' => DUMP_PARSE_TREE.store(true), - 'h' => print_help("fish_indent"), - 'v' => printf!( - "%s", - wgettext_fmt!( - "%s, version %s\n", - PROGRAM_NAME.get().unwrap(), - crate::BUILD_VERSION - ) - ), + 'h' => { + print_help("fish_indent"); + return STATUS_CMD_OK.unwrap(); + } + 'v' => { + printf!( + "%s", + wgettext_fmt!( + "%s, version %s\n", + PROGRAM_NAME.get().unwrap(), + crate::BUILD_VERSION + ) + ); + return STATUS_CMD_OK.unwrap(); + } 'w' => output_type = OutputType::File, 'i' => do_indent = false, '\x01' => output_type = OutputType::Html,