mirror of
https://github.com/xorgy/mediafire-fuse
synced 2026-01-13 21:24:28 -08:00
Refactor commandline handling
- instead of having the list of commandline arguments, their handlers and their help strings in different places, unify them in a single array - this allows to only change one piece of code when adding new arguments
This commit is contained in:
11
cmd_file.c
11
cmd_file.c
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Bryan Christ <bryan.christ@mediafire.com>
|
||||
* 2014 Johannes Schauer <j.schauer@email.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2, as published by
|
||||
@@ -25,14 +26,22 @@
|
||||
#include "private.h"
|
||||
|
||||
int
|
||||
mfshell_cmd_file(mfshell_t *mfshell,const char *quickkey)
|
||||
mfshell_cmd_file(mfshell_t *mfshell, int argc, char **argv)
|
||||
{
|
||||
extern int term_width;
|
||||
file_t *file;
|
||||
int len;
|
||||
int retval;
|
||||
const char *quickkey;
|
||||
|
||||
if(mfshell == NULL) return -1;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Invalid number of arguments\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
quickkey = argv[1];
|
||||
if(quickkey == NULL) return -1;
|
||||
|
||||
len = strlen(quickkey);
|
||||
|
||||
Reference in New Issue
Block a user