Skip to content

[FEATURE request] Command-line interface and language-agnostic configuration language #20

@SamuelMarks

Description

@SamuelMarks

For use in other languages, it would be great to expose a C FFI and (more easily done first) a CLI interface with a language-agnostic configuration language, something like:

# Global to all service-manager-rs
constants: &global_const
   ${if_win}:
      exe: ".exe"
   ${if_not_win}:
      exe: ""

Then you'd roughly have:

name: service_name
constants: &constants
    prefix:
        ${if_win}:
            "%TMP%\foo"
        ${if_not_win}:
            "/tmp/foo"
lifecycle:
   start:  my_init*global_const.exe --prefix *constants.prefix start
   reload: my_init*global_const.exe --prefix *constants.prefix reload
   stop:   my_init*global_const.exe --prefix *constants.prefix stop

Which could be used like so:

$ server-manager install -c "my_yaml_file.yml"
$ server-manager remove "service_name"

And alternatively be specified all at the CLI:

$ server-manager install "my_init" --start "my_init start" --reload "my_init reload" --stop "my_init stop"
$ server-manager remove  "my_init"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions