Allow users to pass options "through" the backend to the frontend

Issue #25 resolved
Botond Ballo repo owner created an issue

Since the backend doesn't currently have any options of its own, a simple first thing to do could be to have the backend just forward any options it receives to the frontend.

If the backend later gains options of its own, we'd need to add a way to distinguish its own options from the frontend options (this comes up fairly frequently, e.g. with cargo and the program it runs; using -- as a separator, as cargo does, is a common solution).

Another approach would be not passing through options, but exposing a subset of the frontend's options (possibly in modified form) via the backend's own options.

Comments (3)

  1. Botond Ballo reporter

    This is made a bit more complicated by the fact that backend currently passes --color=true (because that's what I'd like to be the default).

    We can't just append the arguments passed to the backend after the --color=true, because if the arguments passed also contain --color, the frontend will complain that error: The argument '--color <COLORDEPTH>' was provided more than once, but cannot be used multiple times. To handle this properly, we'd need to parse the arguments to see if they contain --color, and if so omit the --color=true. But the whole point of "passing through" the arguments is to avoid parsing them in the backend.

    A simpler approach is to just change the frontend to make --color=true the default.

  2. Botond Ballo reporter

    Pass options passed to the cfviz command through to the frontend (fixes #25)

    This allows users to control the color mode and other options by passing appropriate arguments to the cfviz command.

    As part of this change, the files backend/color/* are removed, and the instructions in the README to use an alternative coloring scheme updated to use arguments passed to the cfviz command instead.

    → <<cset 2e13c85a5ef9>>

  3. Log in to comment