Skip to content

Commit

Permalink
Add -q option for quickstart (#67)
Browse files Browse the repository at this point in the history
* Add -q option for quickstart

* Update docs

* changelog

* Add option test
  • Loading branch information
jcs090218 authored Dec 9, 2022
1 parent 6d7b004 commit c49cf8a
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 56 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
* Generate log files in user directory (974a17e3b573520a775f813c72ecbd30a32012bf)
* Make sure there is no eval error in the root layer (fbd8eb4b91dfbb614b2b59a1a2a7fea9f594313d)
* Recognize `bsdtar` for windows (#64)
* Add `-q`/`--quick` option for quickstart (#67)

## 0.7.x
> Released Sep 08, 2022
Expand Down
55 changes: 28 additions & 27 deletions docs/content/en/Getting Started/Basic Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ Usage: eask <command> [options..]
Commands:
activate [files..] activate package; use to test package activation
archives list out all package archives [aliases: sources]
archives list out all package archives [aliases: sources]
autoloads generate autoloads file
clean-all do all cleaning tasks
clean-elc remove byte compiled files generated by cask build
clean clean up local .eask directory
compile [names..] byte compile all Emacs Lisp files in the package [aliases: build]
concat [names..] concatenate all elisp files [aliases: concatenate]
create <name> create a new elisp project [aliases: new]
compile [names..] byte compile all Emacs Lisp files in the package [aliases: build]
concat [names..] concatenate all elisp files [aliases: concatenate]
create <name> create a new elisp project [aliases: new]
emacs [args..] execute emacs with the appropriate environment
eval [form] evaluate lisp form with a proper PATH
path print the PATH (exec-path) from workspace [aliases: exec-path]
path print the PATH (exec-path) from workspace [aliases: exec-path]
exec [args..] execute command with correct environment PATH set up
files print the list of all package files
info display information about the current package
init create new Eask file in current directory
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
lint <type> run linter
Expand All @@ -60,32 +60,33 @@ Commands:
reinstall [names..] reinstall packages
search [queries..] search packages
test <type> run test
uninstall [names..] uninstall packages [aliases: delete]
uninstall [names..] uninstall packages [aliases: delete]
upgrade [names..] upgrade packages
check-eask [files..] run eask checker
locate print out Eask installed location
upgrade-eask upgrade Eask itself [aliases: upgrade-self]
upgrade-eask upgrade Eask itself [aliases: upgrade-self]
Options:
--version Show version number [boolean]
--help Show usage instructions [boolean]
-g, --global change default workspace to ~/.emacs.d/ [boolean]
-f, --force enable force flag [boolean]
--development, --dev turn on development mode [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]
--timestamps log with timestamps [boolean]
--log-level log with level [boolean]
--log-file, --lf generate log files [boolean]
--elapsed-time, --et show elapsed time between each operation [boolean]
--no-color disable color output [boolean]
--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]
-v, --verbose set verbosity from 0 to 4 [number]
--version Show version number [boolean]
--help Show usage instructions [boolean]
-g, --global change default workspace to ~/.emacs.d/ [boolean]
-q, --quick start eask cleanly without loading the init.el [boolean]
-f, --force enable force flag [boolean]
--development, --dev turn on development mode [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]
--timestamps log with timestamps [boolean]
--log-level log with level [boolean]
--log-file, --lf generate log files [boolean]
--elapsed-time, --et show elapsed time between each operation [boolean]
--no-color disable color output [boolean]
--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]
-v, --verbose set verbosity from 0 to 4 [number]
For more information, find the manual at https://emacs-eask.github.io/
```
Expand Down
18 changes: 13 additions & 5 deletions docs/content/en/Getting Started/Commands and options.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,14 +491,12 @@ Install package `auto-complete` for your Emacs configuration:
$ eask -g [COMMAND]
```

## 🔍 --development, --dev

Notify command with development scope enabled.
## 🔍 --quick, -q

If we attempt to install development dependencies:
Start cleanly without loading the configuration files.

```sh
$ eask --dev [COMMAND]
$ eask -q [COMMAND]
```

## 🔍 --force, -f
Expand All @@ -511,6 +509,16 @@ Force to uninstall the package `dash` even it's a dependency from another packag
$ eask -f [COMMAND]
```

## 🔍 --development, --dev

Notify command with development scope enabled.

If we attempt to install development dependencies:

```sh
$ eask --dev [COMMAND]
```

## 🔍 --debug

Enable debug information.
Expand Down
39 changes: 22 additions & 17 deletions eask
Original file line number Diff line number Diff line change
Expand Up @@ -28,76 +28,81 @@ yargs
'Show usage instructions'
)
.option('global', {
description: 'change default workspace to ~/.emacs.d/',
description: `change default workspace to ~/.emacs.d/`,
alias: 'g',
type: 'boolean',
})
.option('quick', {
description: `start cleanly without loading the configuration files`,
alias: 'q',
type: 'boolean',
})
.option('force', {
description: 'enable force flag',
description: `enable force flag`,
alias: 'f',
type: 'boolean',
})
.option('development', {
description: 'turn on development mode',
description: `turn on development mode`,
alias: 'dev',
type: 'boolean',
})
.option('debug', {
description: 'turn on debug mode',
description: `turn on debug mode`,
type: 'boolean',
})
.option('strict', {
description: 'report error instead of warnings',
description: `report error instead of warnings`,
type: 'boolean',
})
.option('allow-error', {
description: 'continue the executioon even there is error reported',
description: `continue the executioon even there is error reported`,
type: 'boolean',
})
.option('insecure', {
description: 'allow insecure connection',
description: `allow insecure connection`,
type: 'boolean',
})
.option('timestamps', {
description: 'log with timestamps',
description: `log with timestamps`,
type: 'boolean',
})
.option('log-level', {
description: 'log with level',
description: `log with level`,
type: 'boolean',
})
.option('log-file', {
description: 'generate log files',
description: `generate log files`,
alias: 'lf',
type: 'boolean',
})
.option('elapsed-time', {
description: 'show elapsed time between each operation',
description: `show elapsed time between each operation`,
alias: 'et',
type: 'boolean',
})
.option('no-color', {
description: 'disable color output',
description: `disable color output`,
type: 'boolean',
})
.option('proxy', {
description: 'update proxy for HTTP and HTTPS to host',
description: `update proxy for HTTP and HTTPS to host`,
type: 'string',
})
.option('http-proxy', {
description: 'update proxy for HTTP to host',
description: `update proxy for HTTP to host`,
type: 'string',
})
.option('https-proxy', {
description: 'update proxy for HTTPS to host',
description: `update proxy for HTTPS to host`,
type: 'string',
})
.option('no-proxy', {
description: 'set no-proxy to host',
description: `set no-proxy to host`,
type: 'string',
})
.option('verbose', {
description: 'set verbosity from 0 to 4',
description: `set verbosity from 0 to 4`,
alias: 'v',
requiresArg: true,
type: 'number',
Expand Down
12 changes: 7 additions & 5 deletions lisp/_prepare.el
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ the `eask-start' execution.")

;;; Boolean
(defun eask-global-p () (eask--flag "-g")) ; -g, --global
(defun eask-quick-p () (eask--flag "-q")) ; -q, --quick
(defun eask-force-p () (eask--flag "-f")) ; -f, --force
(defun eask-dev-p () (eask--flag "--dev")) ; --dev, --development
(defun eask-debug-p () (eask--flag "--debug")) ; --debug
Expand Down Expand Up @@ -478,7 +479,7 @@ other scripts internally. See function `eask-call'.")

(defconst eask--option-switches
(eask--form-options
'("-g" "-f" "--dev"
'("-g" "-q" "-f" "--dev"
"--debug" "--strict"
"--allow-error"
"--insecure"
Expand Down Expand Up @@ -637,10 +638,11 @@ Eask file in the workspace."
(eask-with-progress
(ansi-green "Loading your configuration... ")
(eask-with-verbosity 'debug
(load (locate-user-emacs-file "early-init.el") t)
(load (locate-user-emacs-file "../.emacs") t)
(load (locate-user-emacs-file "init.el") t))
(ansi-green "done"))
(unless (eask-quick-p)
(load (locate-user-emacs-file "early-init.el") t)
(load (locate-user-emacs-file "../.emacs") t)
(load (locate-user-emacs-file "init.el") t)))
(ansi-green (if (eask-quick-p) "skipped ✗" "done ✓")))
(eask--with-hooks ,@body))
(t
(let* ((user-emacs-directory (expand-file-name (concat ".eask/" emacs-version "/")))
Expand Down
1 change: 1 addition & 0 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function _global_options(argv) {
let flags = [];
/* Boolean type */
flags.push(def_flag(argv.global, '-g'));
flags.push(def_flag(argv.quick, '-q'));
flags.push(def_flag(argv.force, '-f'));
flags.push(def_flag(argv.development, '--dev'));
flags.push(def_flag(argv.debug, '--debug'));
Expand Down
7 changes: 5 additions & 2 deletions test/options/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ echo "Test all options flag"
cd $(dirname "$0")

# Please have these flags in order, see `eask` file in the project root!
eask info --g
eask info -g
eask info --global
eask info --f
eask info -q
eask info --qucik
eask info -f
eask info --force
eask info --dev
eask info --development
Expand All @@ -47,4 +49,5 @@ 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 -v 4
eask info --verbose 4

0 comments on commit c49cf8a

Please sign in to comment.