Flag or config file for dutctl client #239
Replies: 3 comments
-
|
I am not a big fan of this idea for CLI tool. Why not do some equivalent to SSH config? Host harpy
HostName harpy.lab.9e.network
Port 8080
Host *
Port 8000That way you have single file for all the machines (and not million separate files). And have auto-completion just like SSH has? |
Beta Was this translation helpful? Give feedback.
-
|
The u-root It would limit the configuration file to the options provided by the flag arguments, which are one-to-one. In other words, you would statically configure default flags for ductl with no flexibility. Here is an example: Ideally, I would like the option to add servers 1, 2, and 3 to the configuration file. I would set server1 as the default, but I would still like the option to select a different server, perhaps via a flag. Example INI configuration: example how to choose the server: Thoughts? |
Beta Was this translation helpful? Give feedback.
-
|
I'm in favor of Vojtech's and Sylv's ideas. I'd favor yaml, ini, or toml style configs. OG dutctl actually used this concept as well. Neglecting, that dutctl (client/agent) does not need any DUT config anymore, the Having a Edit: Additionally, we could also use the posix-style hierarchy, that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The goal is just to avoid typing flags (e.g. the agent's ip address) anytime, when using the client. So there shall be no more options via this kind of file, then there are anyway via flags.
Besides the usual Linux style config files, the u-root project has a unique but very clear approach with
.flagfile for itsuinitcommand: https://github.com/u-root/u-root?tab=readme-ov-file#init-and-uinitHow It Works
/etc/uinit.flagsin the initramfsuflag.FileToArgv()which converts the file content into an argv-style argument arrayuinit.flags Format Details:
Example uinit.flags:
This would be equivalent to the command line:
##Unique Characteristics:
Common Linux Configuration File Formats
1. INI Format (Most Traditional)
Used by: systemd, git, PHP, Samba, many desktop apps
2. Key-Value/Environment (Simplest)
Used by: /etc/environment, .env files, shell scripts
3. YAML (Human-Friendly Hierarchical)
Used by: Kubernetes, Docker Compose, Ansible, CI/CD systems
4. JSON (Machine-Friendly Structured)
Used by: package.json, VS Code settings, many modern tools
Conclusion
The uinit.flags format is unique - it's designed specifically for command-line argument preservation rather than general configuration, making it more precise than shell-style parsing but less human-readable than traditional config formats.
Beta Was this translation helpful? Give feedback.
All reactions