diff --git a/CHANGELOG.md b/CHANGELOG.md index 01747ba0..a70a07c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * feat(generate/test): Add commands to setup test files (#243) * feat: Add `docs` command (#245) * feat(cmds): Add `recompile` command (#254) +* feat(eask): Use `strict` option (#256) ## 0.9.x > Released Nov 17, 2023 diff --git a/cmds/core/docker.js b/cmds/core/docker.js index 747a665d..37c283d1 100644 --- a/cmds/core/docker.js +++ b/cmds/core/docker.js @@ -26,6 +26,7 @@ exports.builder = async (yargs) => { yargs.help(false); yargs.version(false); yargs.getOptions().narg = []; + yargs.strict(false); yargs.positional('', { description: 'Emacs version to test', type: 'string', diff --git a/cmds/core/emacs.js b/cmds/core/emacs.js index 75e85e25..b71feb95 100644 --- a/cmds/core/emacs.js +++ b/cmds/core/emacs.js @@ -28,6 +28,7 @@ exports.builder = async (yargs) => { yargs.help(false); yargs.version(false); yargs.getOptions().narg = []; + yargs.strict(false); }; exports.handler = async (argv) => { diff --git a/cmds/core/exec.js b/cmds/core/exec.js index b5cbb623..7fdc6a56 100644 --- a/cmds/core/exec.js +++ b/cmds/core/exec.js @@ -26,7 +26,7 @@ exports.builder = async (yargs) => { yargs.help(false); yargs.version(false); yargs.getOptions().narg = []; - //console.warn(yargs.getOptions()); + yargs.strict(false); }; exports.handler = async (argv) => { diff --git a/cmds/core/outdated.js b/cmds/core/outdated.js index f816f415..454f80a9 100644 --- a/cmds/core/outdated.js +++ b/cmds/core/outdated.js @@ -19,6 +19,15 @@ exports.command = ['outdated']; exports.desc = 'Show all outdated dependencies'; +exports.builder = yargs => yargs + .options({ + 'depth': { + description: 'dependency depth level to print', + requiresArg: true, + type: 'number', + group: TITLE_CMD_OPTION, + }, + }); exports.handler = async (argv) => { await UTIL.e_call(argv, 'core/outdated'); diff --git a/docs/content/Getting-Started/Basic-Usage/_index.en.md b/docs/content/Getting-Started/Basic-Usage/_index.en.md index 6ec1bfbc..657625db 100644 --- a/docs/content/Getting-Started/Basic-Usage/_index.en.md +++ b/docs/content/Getting-Started/Basic-Usage/_index.en.md @@ -33,22 +33,22 @@ Usage: eask [options..] Commands: analyze [files..] Run Eask checker - archives List out all package archives [aliases: sources] + archives List out all package archives [aliases: sources] clean Delete various files produced during building compile [names..] Byte-compile `.el' files create Create a new elisp project docker [args..] Launch specified Emacs version in a Docker container - docs [names..] Build documentation [aliases: doc] + docs [names..] Build documentation [aliases: doc] emacs [args..] Execute emacs with the appropriate environment eval [form] Evaluate lisp form with a proper PATH - path [patterns..] Print the PATH (exec-path) from workspace [aliases: exec-path] + path [patterns..] Print the PATH (exec-path) from workspace [aliases: exec-path] exec [args..] Execute command with correct environment PATH set up files [patterns..] Print all package files - format Run formatters [aliases: fmt] + format Run formatters [aliases: fmt] generate Generate files that are used for the development info Display information about the current package init [files..] Initialize project to use Eask - install-deps Automatically install package dependencies [aliases: install-dependencies, prepare] + install-deps Automatically install package dependencies [aliases: install-dependencies, prepare] install [names..] Install packages keywords List available keywords that can be used in the header section link Manage links @@ -58,7 +58,7 @@ Commands: load [files..] Load elisp files outdated Show all outdated dependencies package-directory Print path to package directory - package [destination] Build a package artifact, and put it into the given destination [aliases: pack] + package [destination] Build a package artifact, and put it into the given destination [aliases: pack] recipe Suggest a recipe format recompile [names..] Byte-recompile `.el' files refresh Download package archives @@ -67,31 +67,32 @@ Commands: search [queries..] Search packages status Display the state of the workspace test Run regression/unit tests - uninstall [names..] Uninstall packages [aliases: delete] + uninstall [names..] Uninstall packages [aliases: delete] upgrade [names..] Upgrade packages locate Print out Eask installed location - upgrade-eask Upgrade Eask itself [aliases: upgrade-self] + upgrade-eask Upgrade Eask itself [aliases: upgrade-self] Proxy Options: - --proxy update proxy for HTTP and HTTPS to host [string] - --http-proxy update proxy for HTTP to host [string] - --https-proxy update proxy for HTTPS to host [string] - --no-proxy set no-proxy to host [string] + --proxy update proxy for HTTP and HTTPS to host [string] + --http-proxy update proxy for HTTP to host [string] + --https-proxy update proxy for HTTPS to host [string] + --no-proxy set no-proxy to host [string] Options: - --version output version information and exit [boolean] - --help show usage instructions [boolean] - --show-hidden Show hidden commands and options [boolean] - -g, --global change default workspace to ~/.eask/ [boolean] - -c, --config change default workspace to ~/.emacs.d/ [boolean] - -a, --all enable all flag [boolean] - -q, --quick start cleanly without loading the configuration files [boolean] - -f, --force enable force flag [boolean] - --debug turn on debug mode [boolean] - --strict report error instead of warnings [boolean] - --allow-error continue the executioon even there is error reported [boolean] - --insecure allow insecure connection [boolean] - -v, --verbose set verbosity from 0 to 5 [number] + --version output version information and exit [boolean] + --help show usage instructions [boolean] + --show-hidden Show hidden commands and options [boolean] + -g, --global change default workspace to ~/.eask/ [boolean] + -c, --config change default workspace to ~/.emacs.d/ [boolean] + -a, --all enable all flag [boolean] + -q, --quick start cleanly without loading the configuration files [boolean] + -f, --force enable force flag [boolean] + --debug turn on debug mode [boolean] + --strict report error instead of warnings [boolean] + --allow-error continue the executioon even there is error reported [boolean] + --insecure allow insecure connection [boolean] + --color enable/disable color output with `--no-` prefix [boolean] + -v, --verbose set verbosity from 0 to 5 [number] For more information, find the manual at https://emacs-eask.github.io/ ``` diff --git a/docs/content/Getting-Started/Basic-Usage/_index.zh-tw.md b/docs/content/Getting-Started/Basic-Usage/_index.zh-tw.md index ac7592a4..0dd8b800 100644 --- a/docs/content/Getting-Started/Basic-Usage/_index.zh-tw.md +++ b/docs/content/Getting-Started/Basic-Usage/_index.zh-tw.md @@ -30,22 +30,22 @@ Usage: eask [options..] Commands: analyze [files..] Run Eask checker - archives List out all package archives [aliases: sources] + archives List out all package archives [aliases: sources] clean Delete various files produced during building compile [names..] Byte-compile `.el' files create Create a new elisp project docker [args..] Launch specified Emacs version in a Docker container - docs [names..] Build documentation [aliases: doc] + docs [names..] Build documentation [aliases: doc] emacs [args..] Execute emacs with the appropriate environment eval [form] Evaluate lisp form with a proper PATH - path [patterns..] Print the PATH (exec-path) from workspace [aliases: exec-path] + path [patterns..] Print the PATH (exec-path) from workspace [aliases: exec-path] exec [args..] Execute command with correct environment PATH set up files [patterns..] Print all package files - format Run formatters [aliases: fmt] + format Run formatters [aliases: fmt] generate Generate files that are used for the development info Display information about the current package init [files..] Initialize project to use Eask - install-deps Automatically install package dependencies [aliases: install-dependencies, prepare] + install-deps Automatically install package dependencies [aliases: install-dependencies, prepare] install [names..] Install packages keywords List available keywords that can be used in the header section link Manage links @@ -55,7 +55,7 @@ Commands: load [files..] Load elisp files outdated Show all outdated dependencies package-directory Print path to package directory - package [destination] Build a package artifact, and put it into the given destination [aliases: pack] + package [destination] Build a package artifact, and put it into the given destination [aliases: pack] recipe Suggest a recipe format recompile [names..] Byte-recompile `.el' files refresh Download package archives @@ -64,31 +64,32 @@ Commands: search [queries..] Search packages status Display the state of the workspace test Run regression/unit tests - uninstall [names..] Uninstall packages [aliases: delete] + uninstall [names..] Uninstall packages [aliases: delete] upgrade [names..] Upgrade packages locate Print out Eask installed location - upgrade-eask Upgrade Eask itself [aliases: upgrade-self] + upgrade-eask Upgrade Eask itself [aliases: upgrade-self] Proxy Options: - --proxy update proxy for HTTP and HTTPS to host [string] - --http-proxy update proxy for HTTP to host [string] - --https-proxy update proxy for HTTPS to host [string] - --no-proxy set no-proxy to host [string] + --proxy update proxy for HTTP and HTTPS to host [string] + --http-proxy update proxy for HTTP to host [string] + --https-proxy update proxy for HTTPS to host [string] + --no-proxy set no-proxy to host [string] Options: - --version output version information and exit [boolean] - --help show usage instructions [boolean] - --show-hidden Show hidden commands and options [boolean] - -g, --global change default workspace to ~/.eask/ [boolean] - -c, --config change default workspace to ~/.emacs.d/ [boolean] - -a, --all enable all flag [boolean] - -q, --quick start cleanly without loading the configuration files [boolean] - -f, --force enable force flag [boolean] - --debug turn on debug mode [boolean] - --strict report error instead of warnings [boolean] - --allow-error continue the executioon even there is error reported [boolean] - --insecure allow insecure connection [boolean] - -v, --verbose set verbosity from 0 to 5 [number] + --version output version information and exit [boolean] + --help show usage instructions [boolean] + --show-hidden Show hidden commands and options [boolean] + -g, --global change default workspace to ~/.eask/ [boolean] + -c, --config change default workspace to ~/.emacs.d/ [boolean] + -a, --all enable all flag [boolean] + -q, --quick start cleanly without loading the configuration files [boolean] + -f, --force enable force flag [boolean] + --debug turn on debug mode [boolean] + --strict report error instead of warnings [boolean] + --allow-error continue the executioon even there is error reported [boolean] + --insecure allow insecure connection [boolean] + --color enable/disable color output with `--no-` prefix [boolean] + -v, --verbose set verbosity from 0 to 5 [number] For more information, find the manual at https://emacs-eask.github.io/ ``` diff --git a/eask b/eask index 59cdbc77..bbe3e94e 100644 --- a/eask +++ b/eask @@ -23,7 +23,6 @@ yargs command: '*', handler() { yargs.showHelp(); } }) - .showHelpOnFail(true) .version('version', 'output version information and exit', version) .help('help', 'show usage instructions') .showHidden('show-hidden', 'Show hidden commands and options') @@ -91,10 +90,10 @@ yargs type: 'boolean', hidden: true, }, - 'no-color': { - description: `disable color output`, + 'color': { + description: 'enable/disable color output with `--no-` prefix', type: 'boolean', - hidden: true, + prefix: 'no', }, 'verbose': { description: `set verbosity from 0 to 5`, @@ -125,6 +124,8 @@ yargs group: TITLE_PROXY_OPTION, }, }) + .strict() .demandCommand() + .showHelpOnFail(true) .wrap(yargs.terminalWidth()) .argv; diff --git a/lisp/core/outdated.el b/lisp/core/outdated.el index 8f6557ec..4b6af8c7 100644 --- a/lisp/core/outdated.el +++ b/lisp/core/outdated.el @@ -6,6 +6,11 @@ ;; ;; $ eask outdated ;; +;; +;; Action options: +;; +;; [--depth] dependency level to print +;; ;;; Code: diff --git a/test/commands/local/run.sh b/test/commands/local/run.sh index 52a9dee8..8c438601 100644 --- a/test/commands/local/run.sh +++ b/test/commands/local/run.sh @@ -66,11 +66,11 @@ eask keywords eask run script eask run script test eask run script extra -- Extra arguments! -eask run script -all +eask run script --all eask run command eask run command test eask run command mini-test-3 -- Extra arguments! -eask run command -all +eask run command --all # Exection eask eval "(progn (require 'mini.emacs.pkg.1))" diff --git a/test/options/run.sh b/test/options/run.sh index 5900e549..a14dfbcc 100644 --- a/test/options/run.sh +++ b/test/options/run.sh @@ -31,11 +31,9 @@ eask info --global eask info -a eask info --all eask info -q -eask info --qucik +eask info --quick eask info -f eask info --force -eask info --dev -eask info --development eask info --debug eask info --strict eask info --allow-error @@ -48,6 +46,6 @@ eask info --no-color eask info --proxy localhost:8080 eask info --http-proxy localhost:8080 eask info --https-proxy localhost:8080 -eask info --no-proxy localhost:8080 +#eask info --no-proxy localhost:8080 eask info -v 4 eask info --verbose 4