mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-05-08 11:22:10 +00:00

License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com> Former-commit-id: f7710895557fc2f181dc04b07cef1bf8e612bd9b [formerly bf7a392bc9e83971ddc9ae673f4fedf8772d3ed1] [formerly 06404f0eb55f410bb6cab197021bdd5e5c0991a2 [formerly 2ba5a4275af280b5e4ecd7324a0226af4371f7ab]] Former-commit-id: 5a676627143edb8d7ca474b564fe2ab3c6b610c3 [formerly edbc0e60c66ab62df1611cda766fc8b3c8ac837e] Former-commit-id: 2925d9dd6471f900c59adb495a5c2f7abfe0026e
25 lines
547 B
Go
25 lines
547 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func init() {
|
|
usersCmd.AddCommand(usersExportCmd)
|
|
}
|
|
|
|
var usersExportCmd = &cobra.Command{
|
|
Use: "export <filename>",
|
|
Short: "Export all users to a file.",
|
|
Long: `Export all users to a json or yaml file. Please indicate the
|
|
path to the file where you want to write the users.`,
|
|
Args: jsonYamlArg,
|
|
Run: python(func(cmd *cobra.Command, args []string, d pythonData) {
|
|
list, err := d.store.Users.Gets("")
|
|
checkErr(err)
|
|
|
|
err = marshal(args[0], list)
|
|
checkErr(err)
|
|
}, pythonConfig{}),
|
|
}
|