diff --git a/docs/content/en/Development-API/_index.md b/docs/content/en/Development-API/_index.md index 89eface6..e559c2b4 100644 --- a/docs/content/en/Development-API/_index.md +++ b/docs/content/en/Development-API/_index.md @@ -33,6 +33,70 @@ Command entry point. Each command file should contain this macro somewhere in th ) ``` +# 🚩 Environment + +## 🔍 Variable: eask-has-colors + +Return non-nil if the terminal supports colors. + +```elisp +(when eask-has-colors ... +``` + +## 🔍 Variable: eask-homedir + +Eask's home directory path. + +```elisp +(message "%s" eask-homedir) +``` + +## 🔍 Variable: eask-invocation + +Eask's invocation program path. + +```elisp +(message "%s" eask-invocation) +``` + +It could be the `node` executable or the `eask` executable itself. + +## 🔍 Variable: eask-is-pkg + +Return non-nil if Eask is packaged. + +```elisp +(when eask-is-pkg ... +``` + +## 🔍 Variable: eask-rest + +Eask's arguments after command separator `--'; return a list. + +```sh +$ eask -- args0 args1 +``` + +Output: + +```elisp +(message "%s" eask-rest) ; '(args0 args1) +``` + +## 🔍 Function: eask-rest () + +Eask's arguments after command separator `--'; return a string. + +```sh +$ eask -- args0 args1 +``` + +Output: + +```elisp +(message "%s" (eask-rest)) ; "args0 args1" +``` + # 🚩 Core ## 🔍 Variable: eask-lisp-root @@ -45,9 +109,7 @@ Points to `lisp` directory from the project root. ## 🔍 Function: eask-command () -Return the current command in string. - -Suppose the command is: +Return the current command in string. Suppose the command is: ```sh $ eask init diff --git a/docs/content/zh-TW/Development-API/_index.md b/docs/content/zh-TW/Development-API/_index.md index 7de4278c..17e811e5 100644 --- a/docs/content/zh-TW/Development-API/_index.md +++ b/docs/content/zh-TW/Development-API/_index.md @@ -32,6 +32,70 @@ weight: 700 ) ``` +# 🚩 環境 + +## 🔍 變數: eask-has-colors + +如果終端支援顏色,則傳回非零。 + +```elisp +(when eask-has-colors ... +``` + +## 🔍 變數: eask-homedir + +Eask 的主目錄路徑。 + +```elisp +(message "%s" eask-homedir) +``` + +## 🔍 變數: eask-invocation + +Eask的呼叫程式路徑。 + +```elisp +(message "%s" eask-invocation) +``` + +它可以是 `node` 可執行檔或 `eask` 執行檔本身。 + +## 🔍 變數: eask-is-pkg + +如果 Eask 已打包,則傳回非零。 + +```elisp +(when eask-is-pkg ... +``` + +## 🔍 變數: eask-rest + +命令分隔符號 `--` 之後的 Eask 參數;傳回一個列表。 + +```sh +$ eask -- args0 args1 +``` + +輸出: + +```elisp +(message "%s" eask-rest) ; '(args0 args1) +``` + +## 🔍 函式: eask-rest () + +命令分隔符號 `--` 之後的 Eask 參數;傳回一個字串。 + +```sh +$ eask -- args0 args1 +``` + +輸出: + +```elisp +(message "%s" (eask-rest)) ; "args0 args1" +``` + # 🚩 核心 ## 🔍 變數: eask-lisp-root @@ -44,9 +108,7 @@ weight: 700 ## 🔍 函式: eask-command () -返回字符串中的當前命令。 - -假設命令是: +返回字符串中的當前命令。假設命令是: ```sh $ eask init diff --git a/lisp/_prepare.el b/lisp/_prepare.el index c9532f72..8197c273 100644 --- a/lisp/_prepare.el +++ b/lisp/_prepare.el @@ -42,7 +42,7 @@ (declare-function ansi-white "ext:ansi.el") ;; -;;; Environments +;;; Environment ;; Determine the underlying operating system (defconst eask-is-windows (memq system-type '(cygwin windows-nt ms-dos)) @@ -79,29 +79,29 @@ Arguments FNC and ARGS are used for advice `:around'." (advice-add 'load :around #'eask--load--adv) (defconst eask-has-colors (getenv "EASK_HASCOLORS") - "Return non-nil if terminal support colors.") + "Return non-nil if terminal supports colors.") (defconst eask-homedir (getenv "EASK_HOMEDIR") - "Eask temporary storage.") + "Eask's home directory path.") (defconst eask-invocation (getenv "EASK_INVOCATION") - "Eask invocation program.") + "Eask's invocation program path.") (defconst eask-is-pkg (getenv "EASK_IS_PKG") - "Eask is pkg.") + "Return non-nil if Eask is packaged.") (defconst eask-rest (let ((args (getenv "EASK_REST_ARGS"))) (setq args (ignore-errors (split-string args ","))) args) - "Eask arguments in list after command separator `--'. + "Eask's arguments after command separator `--'; return a list. -If the argument is `-- hello world'; it will return `(hello world)'.") +If the argument is `-- arg0 arg1'; it will return `(arg0 arg1)'.") (defun eask-rest () - "Eask arguments in string after command separator `--'. + "Eask's arguments after command separator `--'; return a string. -If the argument is `-- hello world'; it will return `hello world'." +If the argument is `-- arg0 arg1'; it will return `arg0 arg1'." (mapconcat #'identity eask-rest " ")) (defcustom eask-import-timeout 10