diff --git a/src/builtin.cpp b/src/builtin.cpp index 39c77ff78..d73867ee2 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -102,7 +102,7 @@ void builtin_wperror(const wchar_t *s, io_streams_t &streams) { } } -static const wchar_t *short_options = L"+:h"; +static const wchar_t *const short_options = L"+:h"; static const struct woption long_options[] = {{L"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0}}; diff --git a/src/builtin_bind.cpp b/src/builtin_bind.cpp index e2ed3b399..179194cf8 100644 --- a/src/builtin_bind.cpp +++ b/src/builtin_bind.cpp @@ -274,7 +274,7 @@ void builtin_bind_t::list_modes(io_streams_t &streams) { int parse_cmd_opts(bind_cmd_opts_t &opts, int *optind, //!OCLINT(high ncss method) int argc, wchar_t **argv, parser_t &parser, io_streams_t &streams) { wchar_t *cmd = argv[0]; - static const wchar_t *short_options = L":aehkKfM:Lm:s"; + static const wchar_t *const short_options = L":aehkKfM:Lm:s"; static const struct woption long_options[] = {{L"all", no_argument, NULL, 'a'}, {L"erase", no_argument, NULL, 'e'}, {L"function-names", no_argument, NULL, 'f'}, diff --git a/src/builtin_block.cpp b/src/builtin_block.cpp index 0e4d5aee3..72652e683 100644 --- a/src/builtin_block.cpp +++ b/src/builtin_block.cpp @@ -23,7 +23,7 @@ struct block_cmd_opts_t { static int parse_cmd_opts(block_cmd_opts_t &opts, int *optind, //!OCLINT(high ncss method) int argc, wchar_t **argv, parser_t &parser, io_streams_t &streams) { wchar_t *cmd = argv[0]; - static const wchar_t *short_options = L":eghl"; + static const wchar_t *const short_options = L":eghl"; static const struct woption long_options[] = {{L"erase", no_argument, NULL, 'e'}, {L"local", no_argument, NULL, 'l'}, {L"global", no_argument, NULL, 'g'}, diff --git a/src/builtin_builtin.cpp b/src/builtin_builtin.cpp index e10f17b49..bc59f1369 100644 --- a/src/builtin_builtin.cpp +++ b/src/builtin_builtin.cpp @@ -18,7 +18,7 @@ struct builtin_cmd_opts_t { bool print_help = false; bool list_names = false; }; -static const wchar_t *short_options = L":hn"; +static const wchar_t *const short_options = L":hn"; static const struct woption long_options[] = { {L"help", no_argument, NULL, 'h'}, {L"names", no_argument, NULL, 'n'}, {NULL, 0, NULL, 0}}; diff --git a/src/builtin_command.cpp b/src/builtin_command.cpp index 13dc1ad3d..50b985691 100644 --- a/src/builtin_command.cpp +++ b/src/builtin_command.cpp @@ -20,7 +20,7 @@ struct command_cmd_opts_t { bool quiet = false; bool all_paths = false; }; -static const wchar_t *short_options = L":ahqsv"; +static const wchar_t *const short_options = L":ahqsv"; static const struct woption long_options[] = {{L"help", no_argument, NULL, 'h'}, {L"all", no_argument, NULL, 'a'}, {L"quiet", no_argument, NULL, 'q'}, diff --git a/src/builtin_commandline.cpp b/src/builtin_commandline.cpp index 9024211ec..6b2fdf003 100644 --- a/src/builtin_commandline.cpp +++ b/src/builtin_commandline.cpp @@ -206,7 +206,7 @@ int builtin_commandline(parser_t &parser, io_streams_t &streams, wchar_t **argv) return STATUS_CMD_ERROR; } - static const wchar_t *short_options = L":abijpctwforhI:CLSsP"; + static const wchar_t *const short_options = L":abijpctwforhI:CLSsP"; static const struct woption long_options[] = {{L"append", no_argument, NULL, 'a'}, {L"insert", no_argument, NULL, 'i'}, {L"replace", no_argument, NULL, 'r'}, diff --git a/src/builtin_complete.cpp b/src/builtin_complete.cpp index 2a5166272..d40a4e303 100644 --- a/src/builtin_complete.cpp +++ b/src/builtin_complete.cpp @@ -130,7 +130,7 @@ int builtin_complete(parser_t &parser, io_streams_t &streams, wchar_t **argv) { wcstring_list_t wrap_targets; bool preserve_order = false; - static const wchar_t *short_options = L":a:c:p:s:l:o:d:frxeuAn:C::w:hk"; + static const wchar_t *const short_options = L":a:c:p:s:l:o:d:frxeuAn:C::w:hk"; static const struct woption long_options[] = {{L"exclusive", no_argument, NULL, 'x'}, {L"no-files", no_argument, NULL, 'f'}, {L"require-parameter", no_argument, NULL, 'r'}, diff --git a/src/builtin_contains.cpp b/src/builtin_contains.cpp index 346e267f1..18d067a5c 100644 --- a/src/builtin_contains.cpp +++ b/src/builtin_contains.cpp @@ -16,7 +16,7 @@ struct contains_cmd_opts_t { bool print_help = false; bool print_index = false; }; -static const wchar_t *short_options = L"+:hi"; +static const wchar_t *const short_options = L"+:hi"; static const struct woption long_options[] = { {L"help", no_argument, NULL, 'h'}, {L"index", no_argument, NULL, 'i'}, {NULL, 0, NULL, 0}}; diff --git a/src/builtin_echo.cpp b/src/builtin_echo.cpp index d10b1d581..c59a5fcfa 100644 --- a/src/builtin_echo.cpp +++ b/src/builtin_echo.cpp @@ -17,7 +17,7 @@ struct echo_cmd_opts_t { bool print_spaces = true; bool interpret_special_chars = false; }; -static const wchar_t *short_options = L"+:Eens"; +static const wchar_t *const short_options = L"+:Eens"; static const struct woption *long_options = NULL; static int parse_cmd_opts(echo_cmd_opts_t &opts, int *optind, int argc, wchar_t **argv, diff --git a/src/builtin_exit.cpp b/src/builtin_exit.cpp index 9a15de052..ce7f1d429 100644 --- a/src/builtin_exit.cpp +++ b/src/builtin_exit.cpp @@ -17,7 +17,7 @@ struct exit_cmd_opts_t { bool print_help = false; }; -static const wchar_t *short_options = L":h"; +static const wchar_t *const short_options = L":h"; static const struct woption long_options[] = {{L"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0}}; diff --git a/src/builtin_function.cpp b/src/builtin_function.cpp index 7e90c154e..b1bccdbfd 100644 --- a/src/builtin_function.cpp +++ b/src/builtin_function.cpp @@ -37,7 +37,7 @@ struct function_cmd_opts_t { // This command is atypical in using the "+" (REQUIRE_ORDER) option for flag parsing. // This is needed due to the semantics of the -a/--argument-names flag. -static const wchar_t *short_options = L"+:a:d:e:hj:p:s:v:w:SV:"; +static const wchar_t *const short_options = L"+:a:d:e:hj:p:s:v:w:SV:"; static const struct woption long_options[] = {{L"description", required_argument, NULL, 'd'}, {L"on-signal", required_argument, NULL, 's'}, {L"on-job-exit", required_argument, NULL, 'j'}, diff --git a/src/builtin_functions.cpp b/src/builtin_functions.cpp index 8d1bc992e..4c3cb4623 100644 --- a/src/builtin_functions.cpp +++ b/src/builtin_functions.cpp @@ -39,7 +39,7 @@ struct functions_cmd_opts_t { wchar_t *handlers_type = NULL; wchar_t *description = NULL; }; -static const wchar_t *short_options = L":HDacd:ehnqv"; +static const wchar_t *const short_options = L":HDacd:ehnqv"; static const struct woption long_options[] = { {L"erase", no_argument, NULL, 'e'}, {L"description", required_argument, NULL, 'd'}, {L"names", no_argument, NULL, 'n'}, {L"all", no_argument, NULL, 'a'}, diff --git a/src/builtin_history.cpp b/src/builtin_history.cpp index 897acecf8..d86311531 100644 --- a/src/builtin_history.cpp +++ b/src/builtin_history.cpp @@ -42,7 +42,7 @@ struct history_cmd_opts_t { /// the non-flag subcommand form. While many of these flags are deprecated they must be /// supported at least until fish 3.0 and possibly longer to avoid breaking everyones /// config.fish and other scripts. -static const wchar_t *short_options = L":CRcehmn:pt::z"; +static const wchar_t *const short_options = L":CRcehmn:pt::z"; static const struct woption long_options[] = {{L"prefix", no_argument, NULL, 'p'}, {L"contains", no_argument, NULL, 'c'}, {L"help", no_argument, NULL, 'h'}, diff --git a/src/builtin_jobs.cpp b/src/builtin_jobs.cpp index 8b05fbaf0..7b585e376 100644 --- a/src/builtin_jobs.cpp +++ b/src/builtin_jobs.cpp @@ -119,7 +119,7 @@ int builtin_jobs(parser_t &parser, io_streams_t &streams, wchar_t **argv) { int mode = JOBS_DEFAULT; int print_last = 0; - static const wchar_t *short_options = L":cghlpq"; + static const wchar_t *const short_options = L":cghlpq"; static const struct woption long_options[] = { {L"command", no_argument, NULL, 'c'}, {L"group", no_argument, NULL, 'g'}, diff --git a/src/builtin_math.cpp b/src/builtin_math.cpp index e67064681..41622d602 100644 --- a/src/builtin_math.cpp +++ b/src/builtin_math.cpp @@ -34,7 +34,7 @@ struct math_cmd_opts_t { // This command is atypical in using the "+" (REQUIRE_ORDER) option for flag parsing. // This is needed because of the minus, `-`, operator in math expressions. -static const wchar_t *short_options = L"+:hs:"; +static const wchar_t *const short_options = L"+:hs:"; static const struct woption long_options[] = {{L"scale", required_argument, NULL, 's'}, {L"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0}}; diff --git a/src/builtin_read.cpp b/src/builtin_read.cpp index 88768445e..a6e283cee 100644 --- a/src/builtin_read.cpp +++ b/src/builtin_read.cpp @@ -54,7 +54,7 @@ struct read_cmd_opts_t { bool one_line = false; }; -static const wchar_t *short_options = L":Aac:d:ghiLlm:n:p:suxzP:UR:LB"; +static const wchar_t *const short_options = L":Aac:d:ghiLlm:n:p:suxzP:UR:LB"; static const struct woption long_options[] = { {L"array", no_argument, NULL, 'a'}, {L"all-lines", no_argument, NULL, 'A'}, diff --git a/src/builtin_return.cpp b/src/builtin_return.cpp index 7e1cc2cf2..27ce2beda 100644 --- a/src/builtin_return.cpp +++ b/src/builtin_return.cpp @@ -17,7 +17,7 @@ struct return_cmd_opts_t { bool print_help = false; }; -static const wchar_t *short_options = L":h"; +static const wchar_t *const short_options = L":h"; static const struct woption long_options[] = {{L"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0}}; diff --git a/src/builtin_set.cpp b/src/builtin_set.cpp index 6b2d38950..8a4eaec1e 100644 --- a/src/builtin_set.cpp +++ b/src/builtin_set.cpp @@ -48,7 +48,7 @@ struct set_cmd_opts_t { // Variables used for parsing the argument list. This command is atypical in using the "+" // (REQUIRE_ORDER) option for flag parsing. This is not typical of most fish commands. It means // we stop scanning for flags when the first non-flag argument is seen. -static const wchar_t *short_options = L"+:LSUaeghlnpqux"; +static const wchar_t *const short_options = L"+:LSUaeghlnpqux"; static const struct woption long_options[] = { {L"export", no_argument, NULL, 'x'}, {L"global", no_argument, NULL, 'g'}, {L"local", no_argument, NULL, 'l'}, {L"erase", no_argument, NULL, 'e'}, diff --git a/src/builtin_set_color.cpp b/src/builtin_set_color.cpp index c39a9c828..13ae662f7 100644 --- a/src/builtin_set_color.cpp +++ b/src/builtin_set_color.cpp @@ -49,7 +49,7 @@ static int set_color_builtin_outputter(char c) { return 0; } -static const wchar_t *short_options = L":b:hvoidrcu"; +static const wchar_t *const short_options = L":b:hvoidrcu"; static const struct woption long_options[] = {{L"background", required_argument, NULL, 'b'}, {L"help", no_argument, NULL, 'h'}, {L"bold", no_argument, NULL, 'o'}, diff --git a/src/builtin_status.cpp b/src/builtin_status.cpp index f2f2ed17b..c60391dd5 100644 --- a/src/builtin_status.cpp +++ b/src/builtin_status.cpp @@ -98,7 +98,7 @@ struct status_cmd_opts_t { /// the non-flag subcommand form. While these flags are deprecated they must be supported at /// least until fish 3.0 and possibly longer to avoid breaking everyones config.fish and other /// scripts. -static const wchar_t *short_options = L":L:cbilfnhj:t"; +static const wchar_t *const short_options = L":L:cbilfnhj:t"; static const struct woption long_options[] = {{L"help", no_argument, NULL, 'h'}, {L"is-command-substitution", no_argument, NULL, 'c'}, {L"is-block", no_argument, NULL, 'b'}, diff --git a/src/builtin_ulimit.cpp b/src/builtin_ulimit.cpp index 0a3c7d650..f7b9cf4c8 100644 --- a/src/builtin_ulimit.cpp +++ b/src/builtin_ulimit.cpp @@ -157,7 +157,7 @@ int builtin_ulimit(parser_t &parser, io_streams_t &streams, wchar_t **argv) { bool soft = false; int what = RLIMIT_FSIZE; - static const wchar_t *short_options = L":HSacdflmnstuvh"; + static const wchar_t *const short_options = L":HSacdflmnstuvh"; static const struct woption long_options[] = { {L"all", no_argument, NULL, 'a'}, {L"hard", no_argument, NULL, 'H'}, diff --git a/src/builtin_wait.cpp b/src/builtin_wait.cpp index 905ebf42b..fe9ea2889 100644 --- a/src/builtin_wait.cpp +++ b/src/builtin_wait.cpp @@ -185,7 +185,7 @@ int builtin_wait(parser_t &parser, io_streams_t &streams, wchar_t **argv) { int argc = builtin_count_args(argv); bool any_flag = false; // flag for -n option - static const wchar_t *short_options = L":n"; + static const wchar_t *const short_options = L":n"; static const struct woption long_options[] = {{L"any", no_argument, NULL, 'n'}, {NULL, 0, NULL, 0}};