[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 9ee2a867e6 481/500: nix-flake: Follow the termino
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 9ee2a867e6 481/500: nix-flake: Follow the terminology and syntax of the guideline |
Date: |
Sat, 29 Jan 2022 08:27:58 -0500 (EST) |
branch: elpa/nix-mode
commit 9ee2a867e60903c4818e0ff9207433a44c5d40f7
Author: Akira Komamura <akira.komamura@gmail.com>
Commit: Akira Komamura <akira.komamura@gmail.com>
nix-flake: Follow the terminology and syntax of the guideline
According to the guideline, *arguments* refer to required arguments,
which is either a flake ref or installable for most commands.
*Options* refer to both boolean flags and other optional arguments
starting with hyphen. It is better to stick with the terminology.
Also, options are appended to the command line after the required
arguments, so follow the rule as well.
For details, see
https://nixos.org/manual/nix/stable/contributing/cli-guideline.html
---
nix-flake.el | 96 ++++++++++++++++++++++++++++++------------------------------
1 file changed, 48 insertions(+), 48 deletions(-)
diff --git a/nix-flake.el b/nix-flake.el
index c339f972ae..8d7dead24c 100644
--- a/nix-flake.el
+++ b/nix-flake.el
@@ -242,130 +242,130 @@ transient.el."
;;;;; Building command lines
-(defun nix-flake--args ()
- "Return arguments for Nix command."
+(defun nix-flake--options ()
+ "Return a list of options for `nix-flake-dispatch'."
;; You could use `flatten-tree' in Emacs 27.1.
(apply #'append (transient-args 'nix-flake-dispatch)))
-(defun nix-flake--command (subcommand nix-args flake-ref &optional args)
+(defun nix-flake--command (subcommand options flake-ref)
"Build a command line for a Nix subcommand.
SUBCOMMAND is a string or a list of strings which is a subcommand of Nix.
-NIX-ARGS is a list of string passed directly after the
-subcommand, before FLAKE-REF. ARGS is extra arguments to the
+OPTIONS is a list of options appended after FLAKE-REF.
+
+COMMAND-ARGUMENTS is extra arguments to the
command after the flake reference."
(concat nix-executable
- " "
+ " "
(mapconcat #'shell-quote-argument
`(,@(nix-flake--to-list subcommand)
- ,@nix-args
- ,flake-ref)
- " ")
- (if args
- (concat " -- " args)
- "")))
+ ,flake-ref
+ ,@options)
+ " ")))
-(defun nix-flake--installable-command (subcommand nix-args flake-ref attribute
- &optional args)
+(defun nix-flake--installable-command (subcommand options flake-ref attribute
+ &optional extra-arguments)
"Build a command line for a Nix subcommand.
This is like `nix-flake--command', but for a subcommand which
takes an installable as an argument. See the user manual of Nix
for what installable means.
-SUBCOMMAND, NIX-ARGS, and FLAKE-REF are the same as in the
+SUBCOMMAND, OPTIONS, and FLAKE-REF are the same as in the
function. ATTRIBUTE is the name of a package, app, or anything
that refers to a derivation in the flake. It must be a string
that is concatenated with the sharp symbol in the installable
-reference. ARGS is a list of strings passed to the Nix command
+reference.
+
+EXTRA-ARGUMENTS is a list of strings passed to the Nix command
after \"--\". Note that some commands such as \"nix build\" do
not take the extra arguments."
(concat nix-executable
" "
(mapconcat #'shell-quote-argument
`(,@(nix-flake--to-list subcommand)
- ,@nix-args
,(if attribute
(concat flake-ref "#" attribute)
- flake-ref))
+ flake-ref)
+ ,@options)
" ")
- (if args
- (concat " -- " args)
+ (if extra-arguments
+ (concat " -- " extra-arguments)
"")))
;;;;; Individual subcommands
-(defun nix-flake-run-attribute (args flake-ref attribute command-args)
+(defun nix-flake-run-attribute (options flake-ref attribute command-args)
"Run an app in the current flake.
-ARGS and FLAKE-REF are the same as in other Nix commands.
+OPTIONS and FLAKE-REF are the same as in other Nix commands.
ATTRIBUTE is the name of a package or app in the flake, and
COMMAND-ARGS is an optional list of strings passed to the
application."
- (interactive (list (nix-flake--args)
+ (interactive (list (nix-flake--options)
nix-flake-ref
(completing-read "Nix app/package: "
(nix-flake--run-attribute-names))
nil))
- (compile (nix-flake--installable-command "run" args flake-ref attribute
+ (compile (nix-flake--installable-command "run" options flake-ref attribute
command-args)))
-(defun nix-flake-run-default (args flake-ref command-args)
+(defun nix-flake-run-default (options flake-ref command-args)
"Run the default app or package in the current flake.
-For ARGS, FLAKE-REF, and COMMAND-ARGS, see the documentation of
+For OPTIONS, FLAKE-REF, and COMMAND-ARGS, see the documentation of
`nix-flake-run-attribute'."
- (interactive (list (nix-flake--args)
+ (interactive (list (nix-flake--options)
nix-flake-ref
nil))
- (compile (nix-flake--installable-command "run" args flake-ref nil
+ (compile (nix-flake--installable-command "run" options flake-ref nil
command-args)))
-(defun nix-flake-build-attribute (args flake-ref attribute)
+(defun nix-flake-build-attribute (options flake-ref attribute)
"Build a derivation in the current flake.
-For ARGS, FLAKE-REF, and ATTRIBUTE, see the documentation of
+For OPTIONS, FLAKE-REF, and ATTRIBUTE, see the documentation of
`nix-flake-run-attribute'."
- (interactive (list (nix-flake--args)
+ (interactive (list (nix-flake--options)
nix-flake-ref
(completing-read "Nix package: "
(nix-flake--build-attribute-names))))
- (compile (nix-flake--installable-command "build" args flake-ref attribute)))
+ (compile (nix-flake--installable-command "build" options flake-ref
attribute)))
-(defun nix-flake-build-default (args flake-ref)
+(defun nix-flake-build-default (options flake-ref)
"Build the default package in the current flake.
-For ARGS and FLAKE-REF, see the documentation of
+For OPTIONS and FLAKE-REF, see the documentation of
`nix-flake-run-attribute'."
- (interactive (list (nix-flake--args)
+ (interactive (list (nix-flake--options)
nix-flake-ref))
- (compile (nix-flake--installable-command "build" args flake-ref nil)))
+ (compile (nix-flake--installable-command "build" options flake-ref nil)))
-(defun nix-flake-check (args flake-ref)
+(defun nix-flake-check (options flake-ref)
"Check the flake.
-For ARGS and FLAKE-REF, see the documentation of
+For OPTIONS and FLAKE-REF, see the documentation of
`nix-flake-run-attribute'."
- (interactive (list (nix-flake--args) nix-flake-ref))
- (compile (nix-flake--command '("flake" "check") args flake-ref)))
+ (interactive (list (nix-flake--options) nix-flake-ref))
+ (compile (nix-flake--command '("flake" "check") options flake-ref)))
-(defun nix-flake-lock (args flake-ref)
+(defun nix-flake-lock (options flake-ref)
"Create missing lock file entries.
-For ARGS and FLAKE-REF, see the documentation of
+For OPTIONS and FLAKE-REF, see the documentation of
`nix-flake-run-attribute'."
- (interactive (list (nix-flake--args) nix-flake-ref))
- (compile (nix-flake--command '("flake" "lock") args flake-ref)))
+ (interactive (list (nix-flake--options) nix-flake-ref))
+ (compile (nix-flake--command '("flake" "lock") options flake-ref)))
-(defun nix-flake-update (args flake-ref)
+(defun nix-flake-update (options flake-ref)
"Update the lock file.
-For ARGS and FLAKE-REF, see the documentation of
+For OPTIONS and FLAKE-REF, see the documentation of
`nix-flake-run-attribute'."
- (interactive (list (nix-flake--args) nix-flake-ref))
- (compile (nix-flake--command '("flake" "update") args flake-ref)))
+ (interactive (list (nix-flake--options) nix-flake-ref))
+ (compile (nix-flake--command '("flake" "update") options flake-ref)))
;;;###autoload (autoload 'nix-flake-dispatch "nix-flake" nil t)
(transient-define-prefix nix-flake-dispatch (flake-ref &optional remote)
- [nongnu] elpa/nix-mode 75d2111891 433/500: Merge pull request #129 from nagy/nix-search-separate, (continued)
- [nongnu] elpa/nix-mode 75d2111891 433/500: Merge pull request #129 from nagy/nix-search-separate, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 949cb98ba5 432/500: Set meta.description, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode a8a513770a 436/500: Simplify some functions, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7f689c4161 450/500: In flake.nix, split name into pname and version, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode b12fa70dd7 446/500: Indicate constants, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 53d1fb9687 469/500: nix-flake: Add nix-flake-init, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1604a9cec8 484/500: nix-flake: Allow updating the lockfile, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e167b82e64 493/500: nix-flake: Fix inconsistent state after switching the flake, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 3d04d92d9c 496/500: Merge pull request #144 from akirak/update-cask-on-flake, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode cf957244e7 499/500: Merge pull request #149 from akirak/transient-dep, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9ee2a867e6 481/500: nix-flake: Follow the terminology and syntax of the guideline,
ELPA Syncer <=
- [nongnu] elpa/nix-mode b97d0a0aae 488/500: Merge pull request #141 from akirak/dependabot, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 83980ca7e7 498/500: nix-mode: Add missing transient dependency for nix-flake, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ef2efae30a 482/500: nix-flake: Use flatten-list and bump Emacs to 27.1, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode c4e4f386b7 490/500: chore: Add nix-flake.el to Cask, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 10fc00dba8 015/500: Fix bad setting for indent-tabs-mode., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 630cc427cd 009/500: Update builtins, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 295bcbd919 023/500: Don't indent strings, comments, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7a97635267 025/500: Move to nix-re-file-path, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode c08ae1cdfe 049/500: Add limit arg to looking-back., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 504285ce39 138/500: Remove nix-buffer, ELPA Syncer, 2022/01/29