aboutsummaryrefslogtreecommitdiffstats
path: root/src/exec-cmd.c
Commit message (Collapse)AuthorAgeFilesLines
* cmd_remove: drop file existence checkJoursoir2022-09-081-6/+0
|
* cmd_remove: drop check for empty fileJoursoir2022-09-081-6/+2
| | | | | | | | | | | From the specification: > If path does not name a directory, remove(path) shall be equivalent to unlink(path). > If path names a directory, remove(path) shall be equivalent to rmdir(path). rmdir() will remove a directory only if it is empty, so drop validation for it.
* tree: handle a pointer returned by malloc()Joursoir2022-08-311-0/+8
| | | | | | | | It is wrong to assume that malloc() always returns allocated memory. Unfortunately, it can return NULL. The rest of the code that uses malloc() should be refactored. That's the reason why we can't do it right now.
* exec-cmd: use angle brackets to show that argument should be replacedJoursoir2022-08-311-13/+13
| | | | | | The angle brackets (<>) indicate that the enclosed parameter is mandatory. Man syntax uses italic text for this purpose, but our text is unformatted, so we use characters.
* tree: move printing error into check_sneaky_paths()Joursoir2022-08-251-21/+9
| | | | Avoid repeating the same error messages.
* cmd_showtree: use a constant pointer to store the pathJoursoir2022-08-241-13/+4
| | | | No need to allocate memory.
* cmd_showtree: replace errprint_*() with print_error()Joursoir2022-08-241-35/+36
| | | | | | | | | | Handle errors using goto instead of "do { ... } while(0)". This is one of the steps on the way to get rid of errprint_*() macros and handle errors by yourself. For more context see other patches under the same topic specified below. TOPIC=drop_errprint
* cmd_move: replace errprint_*() with print_error()Joursoir2022-08-241-8/+16
| | | | | | | | This is one of the steps on the way to get rid of errprint_*() macros and handle errors by yourself. For more context see other patches under the same topic specified below. TOPIC=drop_errprint
* cmd_remove: replace errprint_*() with print_error()Joursoir2022-08-241-8/+16
| | | | | | | | This is one of the steps on the way to get rid of errprint_*() macros and handle errors by yourself. For more context see other patches under the same topic specified below. TOPIC=drop_errprint
* cmd_generate: replace errprint_*() with print_error()Joursoir2022-08-241-7/+14
| | | | | | | | This is one of the steps on the way to get rid of errprint_*() macros and handle errors by yourself. For more context see other patches under the same topic specified below. TOPIC=drop_errprint
* cmd_edit: replace errprint_*() with print_error()Joursoir2022-08-241-17/+32
| | | | | | | | This is one of the steps on the way to get rid of errprint_*() macros and handle errors by yourself. For more context see other patches under the same topic specified below. TOPIC=drop_errprint
* cmd_insert: initialize password pointersJoursoir2022-08-221-5/+3
| | | | | The standard says: "If ptr is a null pointer, no action occurs". So, remove conditions.
* cmd_insert: replace errprint_*() with print_error()Joursoir2022-08-221-42/+45
| | | | | | | | | | Handle errors using goto instead of "do { ... } while(0)". This is one of the steps on the way to get rid of errprint_*() macros and handle errors by yourself. For more context see other patches under the same topic specified below. TOPIC=drop_errprint
* cmd_init: replace errprint_*() with print_error()Joursoir2022-08-221-5/+9
| | | | | | | | This is one of the steps on the way to get rid of errprint_*() macros and handle errors by yourself. For more context see other patches under the same topic specified below. TOPIC=drop_errprint
* exec-cmd: add macro to print usage optionsJoursoir2022-08-221-10/+12
|
* tree: rename usageprint() to print_usage()Joursoir2022-08-221-10/+10
| | | | Rename macro based on naming rules.
* tree: usageprint() macro no longer returns an error by itselfJoursoir2022-08-221-10/+31
| | | | | | This patch also does: - Moves usageprint() from constants.h to output.h - Returns an error after using useprint() clearly.
* exec-cmd: help: add info about 'show'Joursoir2021-06-131-1/+4
|
* lpass: call the function of command without argv[0]Joursoir2021-06-121-9/+2
|
* exec-cmd: show: handle argument '--no-color'Joursoir2021-06-111-4/+6
|
* refactor; set correct headers guardJoursoir2021-03-231-1/+1
|
* move cmd to 'exec-cmd.c', fix some memory leak, macros changesJoursoir2021-03-231-0/+495