guix-help-vars.el 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. ;;; guix-help-vars.el --- Variables related to Guix --help output
  2. ;; Copyright © 2015, 2017, 2018 Alex Kost <alezost@gmail.com>
  3. ;; This file is part of Emacs-Guix.
  4. ;; Emacs-Guix is free software; you can redistribute it and/or modify
  5. ;; it under the terms of the GNU General Public License as published by
  6. ;; the Free Software Foundation, either version 3 of the License, or
  7. ;; (at your option) any later version.
  8. ;;
  9. ;; Emacs-Guix is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;;
  14. ;; You should have received a copy of the GNU General Public License
  15. ;; along with Emacs-Guix. If not, see <http://www.gnu.org/licenses/>.
  16. ;;; Commentary:
  17. ;; This file provides regular expressions to parse various "guix
  18. ;; ... --help" outputs and lists of non-receivable items (system types,
  19. ;; hash formats, etc.).
  20. ;;; Code:
  21. ;;; Regexps for parsing "guix ..." outputs
  22. (defvar guix-help-parse-option-regexp
  23. (rx bol " "
  24. (zero-or-one (group "-" (not (any "- ")))
  25. ",")
  26. (one-or-more " ")
  27. (group "--" (one-or-more (or wordchar "-")))
  28. (group (zero-or-one "[")
  29. (zero-or-one "="))
  30. (zero-or-more (not space))
  31. (one-or-more space)
  32. (group (one-or-more any)))
  33. "Common regexp used to find command options.")
  34. (defvar guix-help-parse-command-regexp
  35. (rx bol " "
  36. (group wordchar (one-or-more (or wordchar "-"))))
  37. "Regexp used to find guix commands.
  38. 'Command' means any option not prefixed with '-'. For example,
  39. guix subcommand, system action, importer, etc.")
  40. (defvar guix-help-parse-long-option-regexp
  41. (rx (or " " ", ")
  42. (group "--" (one-or-more (or wordchar "-"))
  43. (zero-or-one "=")))
  44. "Regexp used to find long options.")
  45. (defvar guix-help-parse-short-option-regexp
  46. (rx bol (one-or-more blank)
  47. "-" (group (not (any "- "))))
  48. "Regexp used to find short options.")
  49. (defvar guix-help-parse-package-regexp
  50. (rx bol (group (one-or-more (not blank))))
  51. "Regexp used to find names of the packages.")
  52. (defvar guix-help-parse-list-regexp
  53. (rx bol (zero-or-more blank) "- "
  54. (group (one-or-more (or wordchar "-"))))
  55. "Regexp used to find various lists (lint checkers, graph types).")
  56. (defvar guix-help-parse-regexp-group 1
  57. "Parenthesized expression of regexps used to find commands and
  58. options.")
  59. ;;; Non-receivable lists
  60. (defvar guix-help-source-types
  61. '("package" "all" "transitive")
  62. "List of supported sources types.")
  63. (defvar guix-help-hash-formats
  64. '("nix-base32" "base32" "base16" "hex" "hexadecimal")
  65. "List of supported hash formats.")
  66. (defvar guix-help-refresh-subsets
  67. '("core" "non-core")
  68. "List of supported 'refresh' subsets.")
  69. (defvar guix-help-key-policies
  70. '("interactive" "always" "never")
  71. "List of supported key download policies.")
  72. (defvar guix-help-verify-options
  73. '("repair" "contents")
  74. "List of supported 'verify' options")
  75. (defvar guix-help-elpa-archives
  76. '("gnu" "melpa" "melpa-stable")
  77. "List of supported ELPA archives.")
  78. (defvar guix-help-size-sort-keys
  79. '("closure" "self")
  80. "List of supported sort keys for 'guix size' command.")
  81. (defvar guix-help-search-paths-types
  82. '("exact" "prefix" "suffix")
  83. "List of supported search-paths types for 'guix package' command.")
  84. (defvar guix-help-repl-types
  85. '("guile" "machine")
  86. "List of supported types for 'guix repl' command.")
  87. (defvar guix-help-describe-formats
  88. '("human" "channels" "json" "recutils")
  89. "List of supported formats for 'guix describe' command.")
  90. (defvar guix-help-on-error-strategies
  91. '("nothing-special" "backtrace" "debug")
  92. "List of on-error strategies for 'guix system' command.")
  93. ;;; Default values of various options
  94. (defvar guix-default-hash-format
  95. "nix-base32"
  96. "Default format for 'guix hash' command.")
  97. (defvar guix-default-key-policy
  98. "interactive"
  99. "Default key download policy used by 'guix refresh' command.")
  100. (defvar guix-default-elpa-archive
  101. "gnu"
  102. "Default ELPA archive for 'guix import elpa' command.")
  103. (defvar guix-default-size-sort-key
  104. "closure"
  105. "Default sort key for 'guix size' command.")
  106. (defvar guix-default-search-paths-type
  107. "exact"
  108. "Default search-paths type for 'guix package' command.")
  109. (defvar guix-default-repl-type
  110. "guile"
  111. "Default type for 'guix repl' command.")
  112. (defvar guix-default-describe-format
  113. "human"
  114. "Default format for 'guix describe' command.")
  115. (defvar guix-default-graph-backend
  116. "graphviz"
  117. "Default backend for 'guix graph' command.")
  118. (defvar guix-default-graph-node-type
  119. "package"
  120. "Default node type for 'guix graph' command.")
  121. (defvar guix-default-on-error-strategy
  122. "nothing-special"
  123. "Default on-error strategy for 'guix system' command.")
  124. (provide 'guix-help-vars)
  125. ;;; guix-help-vars.el ends here