id = "calc"
name = "calc"
homepage = "https://github.com/lcn2/calc"
description = "C-style arbitrary precision calculator."
executables = ["calc"]
platforms = ["macos", "linux"]
[dotfiles]
paths = ["~/.calcrc"]
exclude = []
secret = []
side_effect = false
[commands]
format = 1
label = "Evaluate expression"
description = "Evaluate calc expressions given on the command line, optionally dropping into interactive mode. Debug flags, modes and shell-script mode are left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = false, short_attached = false, short_bundles = false }
[[commands.source]]
id = "man"
kind = "manual"
url = "https://raw.githubusercontent.com/lcn2/calc/HEAD/calc.man"
revision = "HEAD 2026-10-27"
evidence = """
.RB [ \\-c ]
.RB [ \\-d ]
.RB [ \\-e ]
.RB [ \\-i ]
.RB [ \\-p ]
.RB [ \\-q ]
.RB [ \\-s ]
.RB [ \\-u ]
.RB [ \\-v ]
.B \\-d
Disable the printing of the opening title.
.B \\-e
Ignore any environment variables on startup.
.B \\-i
Become interactive if possible.
.B \\-p
Pipe processing is enabled by use of
.B \\-q
Disable the reading of the startup scripts.
.B \\-s
By default, all calc_cmd args are evaluated and executed. This flag will disable their evaluation and instead make them available as strings for the argv() builtin function.
.B \\-v
Print the calc version number and exit.
"""
[[commands.field]]
id = "interactive"
label = "Stay interactive"
description = "Drop into interactive mode after the expressions are evaluated."
type = "boolean"
option = ["-i"]
sources = ["man"]
[[commands.field]]
id = "no_title"
label = "No opening title"
type = "boolean"
option = ["-d"]
sources = ["man"]
[[commands.field]]
id = "no_startup"
label = "Skip startup scripts"
type = "boolean"
option = ["-q"]
sources = ["man"]
[[commands.field]]
id = "pipe"
label = "Pipe mode"
description = "No prompt, no header; suited for piping the result onward."
type = "boolean"
option = ["-p"]
sources = ["man"]
[[commands.field]]
id = "as_strings"
label = "Treat arguments as strings"
description = "Do not evaluate the arguments; expose them to argv()."
type = "boolean"
option = ["-s"]
sources = ["man"]
[[commands.field]]
id = "version"
label = "Print version"
type = "boolean"
option = ["-v"]
sources = ["man"]
[[commands.field]]
id = "expression"
label = "Expression"
description = "calc expression to evaluate, for example 2^100."
type = "string"
position = 0
multiple = true
sources = ["man"]
[[commands.task]]
id = "evaluate"
label = "Evaluate expression"
fields = ["expression", "no_title", "no_startup"]
required = ["expression"]
[[commands.task]]
id = "repl"
label = "Interactive session"
fields = ["interactive", "no_startup"]
required = []
[[commands.task]]
id = "version"
label = "Show version"
fields = ["version"]
required = ["version"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["expression", "interactive", "version"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["no_title", "no_startup", "pipe", "as_strings"]