Skip to content

How to implement an option whose value is optional? #418

Open
@EmmaZhu

Description

@EmmaZhu

Is there any way to implement an option (let's say with name "option1") that it works like:

  1. --option1 value1, means to set it to "value1"
  2. --option1, means it's set without a value

Our application is a long running one that we'd like to persist a running checkpoint on disk if user wants to. If user indicates a file path, we write the checkpoint to it; If user just indicate the option to persist the checkpoint but doesn't specify a path, we write the checkpoint to the default path.

Is there any way we can do this?

Thanks
Emma

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions