summaryrefslogtreecommitdiffstats
path: root/cmd/mattermost/commands/config_test.go
Commit message (Collapse)AuthorAgeFilesLines
* [MM-12362] Add CLI command 'config show' (#9536) (#9564)Mukul Rawat2018-10-151-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add the subcommand by creating a new Command instance. * Implemented the structure of the subcommand function. * Register our new command * Write some helper functions * finish the pretty print function * write some test for config show * Refactor and extract the tab printing functionality in its own function * Use app.Config() to create our config object & accept incoming changes * Removed reading the file, make helper functions return string and perform printing inside the command * Remove the previous code for checking presence of arguments and use 'cobra.NoArgs()' instead * Remove named return and instead declare the variable and then return it. * Remove printTab function and simplify printing out tabs using strings.Repeat * Add some functions to test the output * Update the usage and remove a comment * Update the print
* [MM-12360] Created CLI command "config get" (#9534) (#9558)Mukul Rawat2018-10-151-0/+375
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added the get command to get the value of a config setting. * Depending on the config setting it can work on any depth of the setting. * Added test for the get command. * Add print tabs * Remove excess else statements * Return with the value and remove named return variable * Refactor the printMap function and return a string, remove side effects * Improve the error message, use the name argument * Use app.Config() to create our config object * Remove reading the file, make helper functions return string and perform printing inside the command * Remove the tab printing * Add extra quotes on the output * Remove extra code for checking arguments and replaced it with cobra.ExactArgs(1) * Remove buffer from printConfigValues * Add some tests to check the output of the command * Write test for the function 'structToMap' and test for complext nested structs * Write test for the function 'configToMap' and test for complext nested structs * Write test for the function 'printMap' and test for complext maps as input * Write test for the function 'printConfigValues' and test for complext maps as input * Remove commented code * Update the description of the command
* Renaming platform binary to mattermost. (#8801)Christopher Speller2018-05-171-0/+30