Skip to content

export command cleanup. missing newline on stdout output. non functional commands. mismatch in docs #4341

@taltamir

Description

@taltamir

#4020 added export command. there are some minor things leftover to resolve

  1. when exporting a policy to stdout instead of a file, it is missing a newline at the end. which causes graphical glitches in bash as per image below:
    missing-newline

#4476 adds new line after output


  1. The documentation (both online and in --help) is incorrect.

both say you can use 4 methods to specify a target:
a. user@host - does not work.
b. @host - does not work
c. user@host:path - works
d. -global (online docs) or --global (--help documentation) - the correct one is using two dashes.


  1. the online docs at:
    https://kopia.io/docs/reference/command-line/common/policy-export/
    need to be modified with current info. as various things are outdated or incorrect there. it should just copy paste the info from --help after fixing it.

as of v0.18.2 --help outputs:

usage: kopia policy export [<flags>] [<target>...]
Exports the policy to the specified file, or to stdout if none is specified.

Flags:
      --[no-]help             Show context-sensitive help (also try --help-long and
                              --help-man).
      --[no-]version          Show application version.
      --log-file=LOG-FILE     Override log file.
      --log-dir="/home/t/.cache/kopia"  
                              Directory where log files should be written. ($KOPIA_LOG_DIR)
      --log-level=info        Console log level
      --file-log-level=debug  File log level
      --[no-]help-full        Show help for all commands, including hidden
      --config-file="repository.config"  
                              Specify the config file to use ($KOPIA_CONFIG_PATH)
  -p, --password=PASSWORD     Repository password. ($KOPIA_PASSWORD)
      --[no-]persist-credentials  
                              Persist credentials ($KOPIA_PERSIST_CREDENTIALS_ON_CONNECT)
      --[no-]use-keyring      Use Gnome Keyring for storing repository password.
                              ($KOPIA_USE_KEYRING)
      --to-file=TO-FILE       File path to export to
      --[no-]overwrite        Overwrite the file if it exists
      --[no-]global           Select the global policy.

Args:
  [<target>]  Select a particular policy ('user@host','@host','user@host:path' or a local
              path). Use --global to target the global policy.

#4479 partially addresses documentation issues mentioned in 2 and 3 by making it show double dash instead of em-dash. em-dash is incorrect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions