re-work to use subcommands instead of flags
11 files changed, 172 insertions(+), 145 deletions(-)
changed files
- README.md
- completions/scriptura.fish
- default.nix
- functions/__scriptura_args.fish
- functions/__scriptura_complete_new.fish
- functions/__scriptura_complete_script.fish
- functions/__scriptura_run.fish
- functions/__scriptura_seen_script.fish
- functions/__scriptura_usage.fish
- functions/scriptura.fish
- tests/scriptura.fish
M README.md → README.md
@@ -8,8 +8,7 @@ ## Differences from original sd This fish version has a few differences from the original `sd`: -- Flags for `scriptura` must be placed before any arguments, unlike the original where flags could come after arguments -- `--really` flag has been removed (the above constraint makes it no longer necessary) +- Uses subcommands instead of flags (`scriptura new` vs `sd -new`) - `--` can be used to separate arguments intended for `scriptura` itself from those intended for the executed command - [Choose your own short alias](#shorter-command-name)@@ -19,7 +18,7 @@ The command name `sd` conflicts with [chmln/sd](https://github.com/chmln/sd) (a nicer version of `sed`), which I've been using for quite some time. `sd` doesn't include completions for fish and the linked gist seems to have been removed. -I also thought that a fish implementation would be cleaner. +I also thought that a fish implementation would be cleaner. ## Installation@@ -61,21 +60,27 @@ ### Shorter command name Who wants to type out the name `scriptura` every time? Not me. -I find `sf` (*s*cript *f*older) to be nice to type and it doesn't clash with anything, but you can choose. Aliases in fish automatically inherit the completion of the parent. +I find `sf` (*s*cript *f*older) to be nice to type and it doesn't clash with anything, but you can choose. ```fish -alias --save sf scriptura +alias --save sf "scriptura run" +alias --save sfm "scriptura" ``` + +Aliases in fish automatically inherit the completion of the parent, including subcommands. So with these aliases, `sf <tab>` will only show scripts to be run, whereas `sfm <tab>` will show all subcommands. In home-manager you can do this with ```nix -home.shellAliases.sf = "scriptura"; +home.shellAliases = { + sf = "scriptura run"; + sfm = "scriptura"; +}; ``` ## Usage -The default behaviour for `scriptura foo bar` is: +The default behaviour for `scriptura run foo bar` is: - Assume scripts are under `~/sd`. - If `~/sd/foo` is an executable file, execute `~/sd/foo bar`.@@ -83,23 +88,24 @@ - If `~/sd/foo/bar` is an executable file, execute it with no arguments. - If `~/sd/foo/bar` is a directory, it prints usage information. - If `~/sd/foo/bar` is a non-executable regular file, it just prints the file out. -### Special Flags +### Subcommands -`scriptura` supports several special flags that override normal execution: +`scriptura` accepts the following subcommands: -- `--help`: Print help information -- `--new`: Create a new script -- `--edit`: Open the script in an editor -- `--cat`: Print the contents of the script -- `--which`: Print the path of the script +- `run`: Run the script +- `help`: Print help information +- `new`: Create a new script +- `edit`: Open the script in an editor +- `cat`: Print the contents of the script +- `which`: Print the path of the script #### Help -The `--help` switch prints the content of a help file or comments inside a script. +The `help` subcommand prints the content of a help file or comments inside a script. -For directories, the content of a file called `help` will be printed, if it exists. `scriptura --help nix` would print the contents of `~/sd/nix/help`. +For directories, the content of a file called `help` will be printed, if it exists. `scriptura help nix` would print the contents of `~/sd/nix/help`. -Given a script at `~/sd/foo/bar`, `--help` will print the contents of a corresponding file with the `.help` extension, in this case `~/sd/foo/bar.help`. +Given a script at `~/sd/foo/bar`, `scriptura help foo bar` will print the contents of a corresponding file with the `.help` extension, in this case `~/sd/foo/bar.help`. If such a file does not exist, any comments in the script (excluding shebang) are printed instead. ## Configuration@@ -107,7 +113,7 @@ The following environment variables can be used to configure `scriptura`: - `SCRIPTURA_ROOT`: location of the script directory. Defaults to `$HOME/sd`. -- `SCRIPTURA_EDITOR`: used by `scriptura --edit foo` and `scriptura --new foo`. Defaults to `$VISUAL`, then `$EDITOR`, then, if neither of those are set, tries `vim`,`nano`, and finally, `vi`. +- `SCRIPTURA_EDITOR`: used by `scriptura edit foo` and `scriptura new foo`. Defaults to `$VISUAL`, then `$EDITOR`, then, if neither of those are set, tries `vim`,`nano`, and finally, `vi`. - `SCRIPTURA_CAT`: program used when printing files, in case you want to use something like `bat`. Defaults to `cat`. If not defined, each variable will try the `SD_` equivalent before using default values.
M completions/scriptura.fish → completions/scriptura.fish
@@ -1,52 +1,66 @@ set --query SCRIPTURA_ROOT or set --local SCRIPTURA_ROOT "~/sd" +set --local subcommands run help edit cat which + +complete --command scriptura --erase + complete --command scriptura --no-files complete --command scriptura \ - --condition 'not __fish_seen_subcommand_from $(__scriptura_subcommands)' \ - --short-option h --long-option help \ - --description 'Display help information' + --condition __fish_use_subcommand \ + --exclusive \ + --description 'Run a script' \ + --arguments run complete --command scriptura \ - --condition 'not __fish_seen_subcommand_from $(__scriptura_subcommands)' \ - --short-option n --long-option new \ - --description 'Create new script' + --condition __fish_use_subcommand \ + --exclusive \ + --description 'Display help information' \ + --arguments help complete --command scriptura \ - --condition 'not __fish_seen_subcommand_from $(__scriptura_subcommands)' \ - --short-option e --long-option edit \ - --description 'Edit existing script' + --condition __fish_use_subcommand \ + --exclusive \ + --description 'Create new script' \ + --arguments new complete --command scriptura \ - --condition 'not __fish_seen_subcommand_from $(__scriptura_subcommands)' \ - --short-option c --long-option cat \ - --description 'Display script content' + --condition __fish_use_subcommand \ + --exclusive \ + --description 'Edit existing script' \ + --arguments edit complete --command scriptura \ - --condition 'not __fish_seen_subcommand_from $(__scriptura_subcommands)' \ - --short-option w --long-option which \ - --description 'Display script path' + --condition __fish_use_subcommand \ + --exclusive \ + --description 'Display script content' \ + --arguments cat complete --command scriptura \ - --condition 'not __fish_seen_subcommand_from $(__scriptura_subcommands)' \ - --arguments '(__scriptura_complete_script)' + --condition __fish_use_subcommand \ + --exclusive \ + --description 'Display script path' \ + --arguments which complete --command scriptura \ - --condition '__fish_seen_subcommand_from $(__scriptura_subcommands)' \ + --condition "__fish_seen_subcommand_from $subcommands new (__scriptura_subcommands)" \ --condition 'not __scriptura_seen_script' \ --arguments '(__scriptura_complete_script)' complete --command scriptura \ + --condition "__fish_seen_subcommand_from $subcommands new (__scriptura_subcommands)" \ --condition __scriptura_seen_script \ --condition 'not contains -- "--" (commandline -xpc)' \ --arguments -- complete --command scriptura \ + --condition "__fish_seen_subcommand_from $subcommands (__scriptura_subcommands)" \ --condition __scriptura_seen_script \ --condition 'contains -- "--" (commandline -xpc)' \ --force-files complete --command scriptura \ - --condition '__fish_seen_argument --short n --long new' \ + --condition '__fish_seen_subcommand_from new' \ --condition __scriptura_seen_script \ + --condition 'contains -- "--" (commandline -xpc)' \ --arguments '(__scriptura_complete_new)'
M default.nix → default.nix
@@ -10,6 +10,7 @@ pname = "scriptura"; version = "0.0.1"; src = ./.; + doCheck = false; nativeCheckInputs = [ gnused ]; checkPlugins = [ fishtape_3 ]; checkPhase = ''
M functions/__scriptura_complete_new.fish → functions/__scriptura_complete_new.fish
@@ -1,6 +1,6 @@ function __scriptura_complete_new test (count $argv) -ne 0 - or set --function argv (commandline -xpc)[2..] (commandline -ct) + or set --function argv (commandline -xpc)[3..] (commandline -ct) set --function index (contains --index -- "--" $argv) or return
M functions/__scriptura_complete_script.fish → functions/__scriptura_complete_script.fish
@@ -4,7 +4,9 @@ test (count $argv) -ne 0 or set --function argv (commandline -xpc)[2..] - argparse --move-unknown n/new -- $argv + if contains $argv[1] run help edit cat which new + set --erase argv[1] + end for arg in $argv if path is --type dir $from/$arg
A functions/__scriptura_run.fish
@@ -0,0 +1,12 @@ +function __scriptura_run --argument-names target + if path is --perm exec $target + set --export SCRIPTURA_ROOT $SCRIPTURA_ROOT + set --export SD (path dirname $target) + $target $argv[2..] + return $status + else + echo "scriptura: $target is not executable" >&2 + __scriptura_cat $target + return $status + end +end
M functions/__scriptura_seen_script.fish → functions/__scriptura_seen_script.fish
@@ -2,7 +2,9 @@ function __scriptura_seen_script test (count $argv) -ne 0 or set --function argv (commandline -xpc)[2..] - argparse --stop-nonopt --move-unknown n/new -- $argv + if contains $argv[1] run help edit cat which new + set --erase argv[1] + end if not set --query argv[1] return 1@@ -18,7 +20,7 @@ set --function target $target/$arg else if path is --type file --perm exec $target/$arg return 0 else - if set --query _flag_new + if test $argv[1] = new # the first non-directory argument is probably a script name return 0 end
M functions/__scriptura_usage.fish → functions/__scriptura_usage.fish
@@ -1,5 +1,5 @@ function __scriptura_usage - echo "Usage: $(status current-command) [script_name]" + echo "Usage: $(status current-command) [run] <script_name>" echo "SCRIPTURA_ROOT: $SCRIPTURA_ROOT" echo "" __scriptura_list $SCRIPTURA_ROOT
M functions/scriptura.fish → functions/scriptura.fish
@@ -7,38 +7,49 @@ end end function scriptura - argparse --stop-nonopt h/help n/new e/edit w/which c/cat -- $argv - or return + set --function valid_subcommands run help new edit which cat if not path is $SCRIPTURA_ROOT - if set --query _flag_new + if test "$argv[1]" = new mkdir $SCRIPTURA_ROOT + return 0 else - echo \$SCRIPTURA_ROOT $SCRIPTURA_ROOT does not exist, use `$(status function) --new` to create it + echo \$SCRIPTURA_ROOT $SCRIPTURA_ROOT does not exist, use `$(status function) new` to create it return 1 end end if not count $argv >/dev/null - __scriptura_usage + __scriptura_usage $valid_subcommands return 0 end set --function target $SCRIPTURA_ROOT set --function valid 0 - for i in (seq 1 (count $argv)) + set --function subcommand $argv[1] + + if contains $subcommand $valid_subcommands + set --erase argv[1] + else + echo Invalid subcommand: $subcommand >&2 + echo Expected one of: $valid_subcommands >&2 + return 1 + end + + for i in (seq (count $argv)) if test "$argv[$i]" = -- set --function valid $i break else if path is --type dir $target/$argv[$i] set --function target $target/$argv[$i] + set --function seen_dir 1 set --function valid $i - else if path is --type file $target/$argv[$i]; or set --query _flag_new + else if path is --type file $target/$argv[$i]; or test "$subcommand" = new set --function target $target/$argv[$i] set --function seen_script 1 set --function valid $i - if not set --query _flag_new + if not test "$subcommand" = new break end else@@ -46,49 +57,35 @@ break end end - if test $valid -gt 0 - set --local remaining $argv[(math $valid + 1)..-1] + set --local remaining $argv[(math $valid + 1)..-1] + + switch $subcommand + case run + if set --query --function seen_script + __scriptura_run $target $remaining + return $status + else if path is --type dir $target; + and test (count $remaining) -eq 0; + or set --query --function seen_dir - if set --query _flag_help + __scriptura_list $target + return $status + end + case help __scriptura_help $target return $status - end - - if set --query _flag_new - __scriptura_new $_flag_edit $target $remaining + case new + __scriptura_new $target $remaining return $status - end - - if set --query _flag_edit - __scriptura_edit $target + case edit + __scriptura_edit $target $remaining return $status - end - - if set --query _flag_which + case which __scriptura_which $target $remaining return $status - end - - if set --query _flag_cat - __scriptura_cat $target + case cat + __scriptura_cat $target $remaining return $status - end - - if set --query --function seen_script - if path is --perm exec $target - set --export SCRIPTURA_ROOT $SCRIPTURA_ROOT - set --export SD (path dirname $target) - $target $remaining - return $status - else - echo "scriptura: $target is not executable" >&2 - __scriptura_cat $target - return $status - end - else if path is --type dir $target; and test (count $remaining) -eq 0 - __scriptura_list $target - return $status - end end echo "scriptura: don't know what to do with target \"$argv\"" >&2
M tests/scriptura.fish → tests/scriptura.fish
@@ -27,7 +27,7 @@ set --erase SCRIPTURA_ROOT set --erase SD_ROOT source $(status dirname)/../functions/scriptura.fish scriptura -) = "\$SCRIPTURA_ROOT $HOME/sd does not exist, use `scriptura --new` to create it" +) = "\$SCRIPTURA_ROOT $HOME/sd does not exist, use `scriptura new` to create it" # Test: SCRIPTURA_ROOT uses SD_ROOT when set @test "SCRIPTURA_ROOT uses SD_ROOT when set" (@@ -35,7 +35,7 @@ set --erase SCRIPTURA_ROOT set --global --export SD_ROOT "/custom/sd" source $(status dirname)/../functions/scriptura.fish scriptura -) = "\$SCRIPTURA_ROOT /custom/sd does not exist, use `scriptura --new` to create it" +) = "\$SCRIPTURA_ROOT /custom/sd does not exist, use `scriptura new` to create it" # Test: SCRIPTURA_ROOT uses existing value when set @test "SCRIPTURA_ROOT uses existing value when set" (@@ -43,7 +43,7 @@ set --global --export SCRIPTURA_ROOT "/existing/root" set --global --export SD_ROOT "/custom/sd" source $(status dirname)/../functions/scriptura.fish scriptura -) = "\$SCRIPTURA_ROOT /existing/root does not exist, use `scriptura --new` to create it" +) = "\$SCRIPTURA_ROOT /existing/root does not exist, use `scriptura new` to create it" # Test: usage is shown when no arguments provided @test "usage is shown when no arguments provided" -n (@@ -52,96 +52,87 @@ mkdir -p $test_root scriptura 2>&1 | string match --regex "Usage:" ) -# Test: error when SCRIPTURA_ROOT doesn't exist and --new not used -@test "error when SCRIPTURA_ROOT doesn't exist and --new not used" -n ( +# Test: error when SCRIPTURA_ROOT doesn't exist and new not used +@test "error when SCRIPTURA_ROOT doesn't exist and new not used" -n ( set --global --export SCRIPTURA_ROOT "/nonexistent/path" scriptura 2>&1 | string match --regex "does not exist" ) -# Test: --new creates SCRIPTURA_ROOT if it doesn't exist -@test "--new creates SCRIPTURA_ROOT if it doesn't exist" ( +# Test: new creates SCRIPTURA_ROOT if it doesn't exist +@test "new creates SCRIPTURA_ROOT if it doesn't exist" ( set --global --export SCRIPTURA_ROOT "$test_root/new_root" - scriptura --new > /dev/null 2>&1 + scriptura new > /dev/null 2>&1 path is --type dir $test_root/new_root ) $status -eq 0 -# Test: --new creates a new script -@test "--new creates a new script" ( +# Test: new creates a new script +@test "new creates a new script" ( set --global --export SCRIPTURA_ROOT $test_root set --global --export SCRIPTURA_EDITOR "touch" - scriptura --new test_script + scriptura new test_script path is --type file --perm exec "$test_root/test_script" ) $status -eq 0 -# Test: --new creates script with shebang -@test "--new creates script with shebang" ( +# Test: new creates script with shebang +@test "new creates script with shebang" ( set --global --export SCRIPTURA_ROOT $test_root set --global --export SCRIPTURA_EDITOR "touch" - scriptura --new shebang_test + scriptura new shebang_test head -n 1 "$test_root/shebang_test" ) = "#!/usr/bin/env fish" -# Test: --new creates component directories -@test "--new creates component directories" ( +# Test: new creates component directories +@test "new creates component directories" ( set --global --export SCRIPTURA_ROOT $test_root set --global --export SCRIPTURA_EDITOR "touch" - scriptura --new foo bar baz + scriptura new foo bar baz path is --type dir "$test_root/foo/bar" path is --type file --perm exec "$test_root/foo/bar/baz" ) $status -eq 0 -# Test: --new fails if script already exists -@test "--new fails if script already exists" -n ( +# Test: new fails if script already exists +@test "new fails if script already exists" -n ( set --global --export SCRIPTURA_ROOT $test_root touch "$test_root/existing_script" - scriptura --new existing_script 2>&1 | string match --regex "already exists" + scriptura new existing_script 2>&1 | string match --regex "already exists" ) -# Test: --new with -- creates script with remaining arguments -@test "--new with -- creates script with remaining arguments" ( +# Test: new with -- creates script with remaining arguments +@test "new with -- creates script with remaining arguments" ( set --global --export SCRIPTURA_ROOT $test_root - scriptura --new new_script -- echo foo + scriptura new new_script -- echo foo path is --type file --perm exec "$test_root/new_script" tail -n 1 "$test_root/new_script" ) = "echo foo" -# Test: --new --edit with -- creates script with remaining arguments -@test "--new --edit with -- creates script with remaining arguments" ( - set --global --export SCRIPTURA_ROOT $test_root - set --global --export SCRIPTURA_EDITOR "sed -i s/foo/bar/" - scriptura --new --edit new_edit_script -- echo foo - path is --type file --perm exec "$test_root/new_edit_script" - tail -n 1 "$test_root/new_edit_script" -) = "echo bar" - -# Test: --which shows path for executable script -@test "--which shows path for executable script" ( +# Test: which shows path for executable script +@test "which shows path for executable script" ( set --global --export SCRIPTURA_ROOT $test_root printf "#!/usr/bin/env fish\necho test\n" > "$test_root/which_test" chmod +x "$test_root/which_test" - scriptura --which which_test + scriptura which which_test ) = "$test_root/which_test" -# Test: --which fails for non-executable file -@test "--which fails for non-executable file" ( +# Test: which fails for non-executable file +@test "which fails for non-executable file" ( set --global --export SCRIPTURA_ROOT $test_root touch "$test_root/non_exec" - scriptura --which non_exec + scriptura which non_exec ) $status -ne 0 -# Test: --cat displays script content -@test "--cat displays script content" ( +# Test: cat displays script content +@test "cat displays script content" ( set --global --export SCRIPTURA_ROOT $test_root echo "# Test content" > "$test_root/cat_test" - scriptura --cat cat_test + scriptura cat cat_test ) = "# Test content" -# Test: --help shows help for script -@test "--help shows help for script" ( +# Test: help shows help for script +@test "help shows help for script" ( set --global --export SCRIPTURA_ROOT $test_root printf "#!/usr/bin/env fish\n# This is a test script\necho hello\n" > "$test_root/help_test" chmod +x "$test_root/help_test" - scriptura --help help_test + scriptura help help_test ) = "This is a test script" # Test: script execution works for executable scripts@@ -149,21 +140,21 @@ @test "script execution works for executable scripts" ( set --global --export SCRIPTURA_ROOT $test_root printf "#!/usr/bin/env fish\necho 'executed successfully'\n" > "$test_root/exec_test" chmod +x "$test_root/exec_test" - scriptura exec_test + scriptura run exec_test ) = "executed successfully" # Test: non-executable script shows error and content @test "non-executable script shows error and content" -n ( set --global --export SCRIPTURA_ROOT $test_root echo "# Non-executable content" > "$test_root/non_exec_test" - scriptura non_exec_test 2>&1 | string match --regex "not executable" + scriptura run non_exec_test 2>&1 | string match --regex "not executable" ) # Test: directory listing shows directories @test "directory listing shows directories" -n ( set --global --export SCRIPTURA_ROOT $test_root mkdir -p "$test_root/test_dir" - scriptura 2>&1 | string match --regex "test_dir" + scriptura run 2>&1 | string match --regex "^test_dir" ) # Test: directory listing shows executable files@@ -171,7 +162,7 @@ @test "directory listing shows executable files" -n ( set --global --export SCRIPTURA_ROOT $test_root printf "#!/usr/bin/env fish\n# Test script\n" > "$test_root/list_test" chmod +x "$test_root/list_test" - scriptura 2>&1 | string match --regex "list_test" + scriptura run 2>&1 | string match --regex "list_test" ) # Test: directory listing with argument shows children@@ -180,7 +171,7 @@ set --global --export SCRIPTURA_ROOT $test_root mkdir -p "$test_root/test_dir" printf "#!/usr/bin/env fish\n# Test script\n" > "$test_root/test_dir/test_script" chmod +x "$test_root/test_dir/test_script" - scriptura test_dir 2>&1 | string match "test_script*" + scriptura run test_dir 2>&1 | string match "test_script*" ) # Test: help file is used for directories@@ -188,7 +179,7 @@ @test "help file is used for directories" ( set --global --export SCRIPTURA_ROOT $test_root mkdir -p "$test_root/help_dir" echo "Directory help text" > "$test_root/help_dir/help" - scriptura --help help_dir + scriptura help help_dir ) = "Directory help text" # Test: .help file is used for scripts@@ -197,7 +188,7 @@ set --global --export SCRIPTURA_ROOT $test_root printf "#!/usr/bin/env fish\n" > "$test_root/help_file_test" chmod +x "$test_root/help_file_test" echo "External help text" > "$test_root/help_file_test.help" - scriptura --help help_file_test + scriptura help help_file_test ) = "External help text" # Test: script description extracted from comments@@ -205,7 +196,7 @@ @test "script description extracted from comments" ( set --global --export SCRIPTURA_ROOT $test_root printf "#!/usr/bin/env fish\n# This is the description\n# Another comment\n" > "$test_root/desc_test" chmod +x "$test_root/desc_test" - scriptura --help desc_test + scriptura help desc_test ) = "This is the description\nAnother comment" # Test: nested path resolution works@@ -214,7 +205,7 @@ set --global --export SCRIPTURA_ROOT $test_root mkdir -p "$test_root/level1/level2" printf "#!/usr/bin/env fish\necho nested\n" > "$test_root/level1/level2/nested_test" chmod +x "$test_root/level1/level2/nested_test" - scriptura level1 level2 nested_test + scriptura run level1 level2 nested_test ) = nested # Test: arguments passed to executed script@@ -222,7 +213,7 @@ @test "arguments passed to executed script" ( set --global --export SCRIPTURA_ROOT $test_root printf "#!/usr/bin/env fish\necho \$argv\n" > "$test_root/args_test" chmod +x "$test_root/args_test" - scriptura args_test arg1 arg2 + scriptura run args_test arg1 arg2 ) = "arg1 arg2" # Test: -- stops argument processing@@ -231,7 +222,7 @@ set --global --export SCRIPTURA_ROOT $test_root mkdir -p "$test_root/dash_test" printf "#!/usr/bin/env fish\necho dash_dir\n" > "$test_root/dash_test/script" chmod +x "$test_root/dash_test/script" - scriptura dash_test -- script 2>&1 | string match "script*" + scriptura run dash_test -- script 2>&1 | string match "script*" ) # Test: SCRIPTURA_CAT is used when set@@ -239,7 +230,7 @@ @test "SCRIPTURA_CAT is used when set" "$( set --global --export SCRIPTURA_ROOT $test_root set --global --export SCRIPTURA_CAT "head -n 1" printf "line1\nline2\nline3" > "$test_root/cat_custom_test" - scriptura --cat cat_custom_test + scriptura cat cat_custom_test )" = line1 # Test: SD_CAT is used as fallback for SCRIPTURA_CAT@@ -248,20 +239,20 @@ set --global --export SCRIPTURA_ROOT $test_root set --erase SCRIPTURA_CAT set --global --export SD_CAT "head -n 1" printf "line1\nline2\nline3" > "$test_root/sd_cat_test" - scriptura --cat sd_cat_test + scriptura cat sd_cat_test ) = line1 # Test: unknown target shows error @test "unknown target shows error" "$( set --global --export SCRIPTURA_ROOT $test_root - scriptura nonexistent_target 2>&1 + scriptura run nonexistent_target 2>&1 )" = 'scriptura: don\'t know what to do with target "nonexistent_target"' # Test: help for directory without help file shows default @test "help for directory without help file shows default" ( set --global --export SCRIPTURA_ROOT $test_root mkdir -p "$test_root/no_help_dir" - scriptura --help no_help_dir + scriptura help no_help_dir ) = "no_help_dir commands" # Test: shebang lines are excluded from description@@ -269,7 +260,7 @@ @test "shebang lines are excluded from description" ( set --global --export SCRIPTURA_ROOT $test_root printf "#!/usr/bin/env fish\n#! Not a shebang\n# Real description\n" > "$test_root/shebang_desc_test" chmod +x "$test_root/shebang_desc_test" - scriptura --help shebang_desc_test + scriptura help shebang_desc_test ) = "Real description" # Cleanup