Closed EmilyGraceSeville7cf closed 1 year ago
Yeah... I don't see this happening. For three primary reasons:
This alf config
g: git
b: branch
d: diff --unified=0
co: checkout
Would look like this in YAML:
g:
command: git
subcommands:
b: branch
d: diff --unified=0
co: checkout
which is too verbose.
I imagine my personal alf-conf would get quite clunky with such a change.
The inspiration for alf config (and opcode) came from Procfile syntax
There is no real YAML parsing in bash, since there are no nested hashes in bash. At best, there is some simple awkward parsing like I did in the built in YAML library in bashly
What about yq tool? It suits for JSON parsing too, but not just that.
Would look like this in YAML:
Or like this:
g:
git:
b: branch
d: diff --unified=0
co: checkout
What about yq tool?
It adds a dependency, and is more suitable for interacting with single values.
Or like this:
g: git: b: branch d: diff --unified=0 co: checkout
No. The command needs to be a value, not a key, as it is allowed to get complex:
dns: if [[ -n "$2" ]]; then host -t $2 $1; else host $1; fi
flush: !sudo systemd-resolve --flush-caches
stats: !sudo systemd-resolve --statistics
--flush: !dns flush && dns
help: !echo -e "Usage:\n dns example.com\n dns example.com mx\n dns --flush example.com\n dns flush\n dns stats"
Hmm... Then I guess we can at least implement some syntax highlighting for alf config for popular editors and maybe some snippets. Such thing is done for instance for .desktop files in VS Code.
Then I guess we can at least implement some syntax highlighting
We can. This kind of thing is usually out of scope for me personally. I am using the closest available syntax highlight (YAML or Bash for alf.conf for example).
This also requires maintenance per editor, per editor version, across multiple OSes sometimes... The effort/reward ratio for this kind of tasks doesn't sit well with me.
This also requires maintenance per editor, per editor version, across multiple OSes sometimes... The effort/reward ratio for this kind of tasks doesn't sit well with me.
I am not talking about not portable editors here. I mean VS Code, Emacs, Vim, Micro. Furthermore, I can implement syntax highlighting and snippets for some of these editors.
I can implement syntax highlighting and snippets for some of these editors
I am not against it, I just don't want to be left holding the bag :)
I am closing this ticket. If syntax highlighting for alf config becomes a thing, let's do it in a separate issue.
My primary wish is to enable intellisence here. ;)