You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/usr/bin/env nu
|
|
|
|
|
|
|
|
use ./lib/cntfy.nu
|
|
|
|
|
|
|
|
def main [
|
|
|
|
subcommand: string@subcommands
|
|
|
|
] {
|
|
|
|
if $subcommand == "help" {
|
|
|
|
print $"cntfy <subcommand>",
|
|
|
|
print ""
|
|
|
|
print "Subcommands: "
|
|
|
|
|
|
|
|
for subcommand in ( subcommands ) {
|
|
|
|
print ""
|
|
|
|
print $"(ansi {attr: b})($subcommand)(ansi reset)"
|
|
|
|
print ( help $"main ($subcommand)" )
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
let span = (metadata $subcommand).span;
|
|
|
|
error make {
|
|
|
|
msg: $"Unknown subcommand ($subcommand)",
|
|
|
|
label: {
|
|
|
|
text: "Unknown subcommand",
|
|
|
|
start: $span.start,
|
|
|
|
end: $span.end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def subcommands [] {
|
|
|
|
["publish"]
|
|
|
|
}
|
|
|
|
|
|
|
|
alias `main publish` = cntfy publish
|