-
Notifications
You must be signed in to change notification settings - Fork 44
Conversation
…name to be entered as part of the existing command. The command "storj list-buckets [bucket-name]" is used to list the bucket ID of corresponding bucket name, if found in the buckets list. Example: If no bucket name specified, then the command lists all available buckets ./storj list-buckets ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2017-12-15T17:23:25.832Z Name: testbucket ID: 725131c74690150e7b0cc747 Decrypted: true Created: 2017-12-18T16:41:41.583Z Name: testbucket2 ID: 965efd4b5d65fd82643f5727 Decrypted: true Created: 2017-12-18T18:14:05.098Z Name: testbucket3 ID: b20824d412f7a8845379769e Decrypted: true Created: 2017-12-18T18:15:05.270Z Name: testbucket4 Example: If bucket name is specified, then the command lists details specific to the entered bucket name ./storj list-buckets testbucket ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2017-12-15T17:23:25.832Z Name: testbucket Example: If bucket name is specified, but doesnt exists, then the command return error ./storj list-buckets testbucketXYZ Invalid bucket name.
Test Case storj-archived#1: No bucket name given kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj -d list-files Missing first argument: <bucket-id> Test Case storj-archived#2: Complete command with valid bucket name with 2 files in it kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj -d list-files testbucket ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2017-12-15T17:23:25.832Z Name: testbucket ID: 27607c99600540cc4c57953c Size: 9 bytes Decrypted: true Type: application/octet-stream Created: 2017-12-15T17:27:25.461Z Name: testfile.txt ID: ee2fcc89dfe71c932cf44fcc Size: 10 bytes Decrypted: true Type: application/octet-stream Created: 2017-12-15T17:29:38.994Z Name: testfile2.txt Test Case storj-archived#3: Complete command with valid bucket name but no files in it kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj -d list-files testbucket2 ID: 725131c74690150e7b0cc747 Decrypted: true Created: 2017-12-18T16:41:41.583Z Name: testbucket2 No files for bucket. Test Case storj-archived#4: Compete command with invalid bucket name kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj -d list-files testbucket2233432 Invalid bucket name.
Checking in supports "storj list-files [bucket_name]" Test Case storj-archived#1: No bucket name given kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj -d list-files Missing first argument: <bucket-id> Test Case storj-archived#2: Complete command with valid bucket name with 2 files in it kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj -d list-files testbucket ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2017-12-15T17:23:25.832Z Name: testbucket ID: 27607c99600540cc4c57953c Size: 9 bytes Decrypted: true Type: application/octet-stream Created: 2017-12-15T17:27:25.461Z Name: testfile.txt ID: ee2fcc89dfe71c932cf44fcc Size: 10 bytes Decrypted: true Type: application/octet-stream Created: 2017-12-15T17:29:38.994Z Name: testfile2.txt Test Case storj-archived#3: Complete command with valid bucket name but no files in it kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj -d list-files testbucket2 ID: 725131c74690150e7b0cc747 Decrypted: true Created: 2017-12-18T16:41:41.583Z Name: testbucket2 No files for bucket. Test Case storj-archived#4: Compete command with invalid bucket name kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj -d list-files testbucket2233432 Invalid bucket name. on branches master branches master
========================================================================================================== Testcase storj-archived#1: No aruguments entered kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj upload-file Missing arguments: <bucket-name> <path> ======================================================================================================== LIST ALLTHE VALID BUCKETS NAMES kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj list-buckets ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2017-12-15T17:23:25.832Z Name: testbucket ID: 725131c74690150e7b0cc747 Decrypted: true Created: 2017-12-18T16:41:41.583Z Name: testbucket2 ID: 965efd4b5d65fd82643f5727 Decrypted: true Created: 2017-12-18T18:14:05.098Z Name: testbucket3 ID: b20824d412f7a8845379769e Decrypted: true Created: 2017-12-18T18:15:05.270Z Name: testbucket4 ========================================================================================================= PICK A BUCKET AND LIST ALL THE FILES IN THAT BUCKET kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj list-files testbucket2 ID: 725131c74690150e7b0cc747 Decrypted: true Created: 2017-12-18T16:41:41.583Z Name: testbucket2 ID: 4022eed501eb8d008ce61b84 Size: 22 bytes Decrypted: true Type: application/octet-stream Created: 2017-12-21T23:39:17.352Z Name: testfileA.txt ========================================================================================================== TEST CASE#2: Execute the complete upload-file command kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj upload-file testbucket2 testjson.json ID: 725131c74690150e7b0cc747 Decrypted: true Created: 2017-12-18T16:41:41.583Z Name: testbucket2 [======================================================================] 100.00% Upload Success! File ID: 037431e2b0489b41db7a363d ========================================================================================================== LIST THE FILES IN THE ABOVE UPLOADED BUCKET TO VERIFY THAT THE NEW FILES IS LISTED AS WELL kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj list-files testbucket2 ID: 725131c74690150e7b0cc747 Decrypted: true Created: 2017-12-18T16:41:41.583Z Name: testbucket2 ID: 4022eed501eb8d008ce61b84 Size: 22 bytes Decrypted: true Type: application/octet-stream Created: 2017-12-21T23:39:17.352Z Name: testfileA.txt ID: 037431e2b0489b41db7a363d Size: 1448 bytes Decrypted: true Type: application/octet-stream Created: 2017-12-22T13:56:16.628Z Name: testjson.json ========================================================================================================== TEST CASE#3: VALID BUCKET NAME AND INVALID FILE-NAME kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj upload-file testbucket2 testjson.jsondsf ID: 725131c74690150e7b0cc747 Decrypted: true Created: 2017-12-18T16:41:41.583Z Name: testbucket2 Invalid file path: testjson.jsondsf ========================================================================================================== TEST CASE#4: INVALID BUCKET NAME AND INVALID FILE-NAME kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj upload-file testbucket2sfs testjson.jsondsf Invalid bucket name. ========================================================================================================== TEST CASE#4: INVALID BUCKET NAME AND VALID FILE-NAME kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj upload-file testbucket3sfs testjson.json Invalid bucket name. ========================================================================================================== TEST CASE#5: VALID BUCKET NAME AND VALID FILE-NAME kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj upload-file testbucket3 testjson.json ID: 965efd4b5d65fd82643f5727 Decrypted: true Created: 2017-12-18T18:14:05.098Z Name: testbucket3 [======================================================================] 100.00% Upload Success! File ID: f10d046334eea2e7a6ba9723 ========================================================================================================== TEST CASE#6: TRY AGAIN TO UPLOAD THE SAME FILE WITH VALID BUCKET NAME AND VALID FILE-NAME kishore@kishore-Inspiron-13-7353:~/libstorj/src$ ./storj upload-file testbucket3 testjson.json ID: 965efd4b5d65fd82643f5727 Decrypted: true Created: 2017-12-18T18:14:05.098Z Name: testbucket3 Preparing File... Upload failure: File already exists ==========================================================================================================
…d-file cli command using symbolic name
…name> storj://<bucketname>/[filename][.][]
…>/<filename> --> ./storj cp /home/kishore/libstorj/src/teset1 storj://testbucket/* --> Invalid target filename --> ./storj cp /home/kishore/libstorj/src/teset1 storj://testbucket/. --> uploads correctly --> ./storj cp /home/kishore/libstorj/src/teset1 storj://testbucket/teset2 --> Invalid target filename --> ./storj cp /home/kishore/libstorj/src/teset1 storj://testbucket/teset1 --> uploads correctly
Modified the file_exists() to verify the local filename entered is either a directory or a file. Also if it is a directory will print out all the files recursively( from sub directories)
…vely. Commented the printf statements. Uncommenting them, you can see on the stdio
Added the functionality to test ./storj cp /home/kishore/libstorj/src/teset1 storj://testbucket/teset1 ./storj cp /home/kishore/libstorj/src/teset1 storj://testbucket/. ./storj cp /home/kishore/libstorj/src/teset1 storj://testbucket/ ./storj cp -r[R] /home/kishore/libstorj/src/teset1 storj://testbucket/teset1 ./storj cp -r[R] /home/kishore/libstorj/src/teset1 storj://testbucket/. ./storj cp -r[R] /home/kishore/libstorj/src/teset1 storj://testbucket/ Working on uploading the file recursively.
Working on recursive uploads Current implementation ./storj cp /home/kishore/libstorj/src/teset1 storj://testbucket/teset1 ./storj cp /home/kishore/libstorj/src/teset1 storj://testbucket/. ./storj cp /home/kishore/libstorj/src/teset1 storj://testbucket/ ./storj cp -r[R] /home/kishore/libstorj/src/teset1 storj://testbucket/teset1 ./storj cp -r[R] /home/kishore/libstorj/src/teset1 storj://testbucket/. ./storj cp -r[R] /home/kishore/libstorj/src/teset1 storj://testbucket/
…one file is currently uploadable
./storj cp -r /home/kishore/libstorj/src/ storj://testbucket/
…le command using storj cp [-rR]storj://<bucket-name>/<file-name> <local_download_path>
Supported CLI commands ./storj get-bucket-id <bucket-name> Example: ./storj get-bucket-id testbucket ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2018-01-04T16:55:29.832Z Name: testbucket ./storj upload-file <bucket-name> <path-to-local-file-name> Example: ./storj upload-file testbucket3 uploader.lo ID: 965efd4b5d65fd82643f5727 Decrypted: true Created: 2017-12-18T18:14:05.098Z Name: testbucket3 [======================================================================] 100.00% Upload Success! File ID: b8c4543226e9c65f61aa0141 ./storj download-file <bucket-name> <file-name> <path-to-local-file-name> Example: Local file name not given ./storj download-file testbucket3 uploader.o /tmp/. ID: 965efd4b5d65fd82643f5727 Decrypted: true Created: 2017-12-18T18:14:05.098Z Name: testbucket3 stat: No such file or directory Warning: File already exists at path [/tmp/.]. Would you like to overwrite [/tmp/.]: [y/n] y Unable to open /tmp/.: Is a directory Example: Local file name given ./storj download-file testbucket3 uploader.o /tmp/uploader.ks ID: 965efd4b5d65fd82643f5727 Decrypted: true Created: 2017-12-18T18:14:05.098Z Name: testbucket3 [======================================================================] 100.00% Download Success! Example: Downloading with a filename that already exists locally ./storj download-file testbucket3 uploader.o /tmp/uploader.ks ID: 965efd4b5d65fd82643f5727 Decrypted: true Created: 2017-12-18T18:14:05.098Z Name: testbucket3 Warning: File already exists at path [/tmp/uploader.ks]. Would you like to overwrite [/tmp/uploader.ks]: [y/n] y [======================================================================] 100.00% Download Success! ./storj list-files <testbucket-name> Example: List files in a bucket using bucket name ./storj list-files testbucket3 ID: 965efd4b5d65fd82643f5727 Decrypted: true Created: 2017-12-18T18:14:05.098Z Name: testbucket3 ID: f10d046334eea2e7a6ba9723 Size: 1448 bytes Decrypted: true Type: application/octet-stream Created: 2017-12-22T13:57:52.415Z Name: testjson.json ID: 0f58c36885553516ccb63141 Size: 9200 bytes Decrypted: true Type: application/octet-stream Created: 2018-01-09T16:53:18.496Z Name: teset1 ID: 190dc667ba33a72b00e3dbb7 Size: 16528 bytes Decrypted: true Type: application/octet-stream Created: 2018-01-09T17:30:28.090Z Name: rs.o ID: f25ae0dde4fb7b3559e8f089 Size: 94808 bytes Decrypted: true Type: application/octet-stream Created: 2018-01-09T17:31:03.138Z Name: uploader.o ID: b8c4543226e9c65f61aa0141 Size: 279 bytes Decrypted: true Type: application/octet-stream Created: 2018-01-09T17:32:02.076Z Name: uploader.lo ./storj cp <path-to-local-filename> storj://<bucket-name>/<target-file-name> ./storj cp <path-to-local-filename> storj://<bucket-name>/. ./storj cp <path-to-local-filename> storj://<bucket-name>/<blank> Example: uploading a file using ‘cp’ command. The target file name should be same as the upload file name, or ‘.’ or blank(no target file name) Example: Using uploaded file name same as uploading same file ./storj cp /tmp/uploader.ksa storj://testbucket/uploader.ksa ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2018-01-04T16:55:29.832Z Name: testbucket [======================================================================] 100.00% Upload Success! File ID: 3092473ebc48a2d469a4a59d Example: Using uploaded file name same as uploading same file, trying to upload a file already uploaded ./storj cp uploader.o storj://testbucket3/uploader.o ID: 965efd4b5d65fd82643f5727 Decrypted: true Created: 2017-12-18T18:14:05.098Z Name: testbucket3 Preparing File... Upload failure: File already exists Example: Uploading a file to a different bucket ./storj cp uploader.o storj://testbucket2/uploader.o ID: 725131c74690150e7b0cc747 Decrypted: true Created: 2017-12-18T16:41:41.583Z Name: testbucket2 [======================================================================] 100.00% Upload Success! File ID: 6b82f6030fc688336190d768 Example: Using uploaded file name is entered as ‘.’ ./storj cp http.o storj://testbucket3/. ID: 965efd4b5d65fd82643f5727 Decrypted: true Created: 2017-12-18T18:14:05.098Z Name: testbucket3 [======================================================================] 100.00% Upload Success! File ID: 65ac6ea61a175d06bcfa7567 Example: Missing uploaded file name (no file name entered or is blank) ./storj cp rs.lo storj://testbucket3/ [2212] target file name = rs.lo ID: 965efd4b5d65fd82643f5727 Decrypted: true Created: 2017-12-18T18:14:05.098Z Name: testbucket3 [======================================================================] 100.00% Upload Success! File ID: fcd43a40f4543366d09ddb5c ./storj cp storj://<bucket-name>/<target-file-name> <path-to-local-filename> Example: Downloaded file (teset1) same as the downloading file(teset1) ./storj cp storj://testbucket/teset1 /tmp/teset1 ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2018-01-04T16:55:29.832Z Name: testbucket [======================================================================] 100.00% Download Success! Example: Downloaded file(teset2) different from downloading file(teset1) ./storj cp storj://testbucket/teset1 /tmp/teset2 ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2018-01-04T16:55:29.832Z Name: testbucket [======================================================================] 100.00% Download Success! Example: Downloading same as above. The command prompts to overwrite? ./storj cp storj://testbucket/teset1 /tmp/teset2 ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2018-01-04T16:55:29.832Z Name: testbucket Warning: File already exists at path [/tmp/teset2]. Would you like to overwrite [/tmp/teset2]: [y/n] y [======================================================================] 100.00% Download Success! Example: Downloaded file name not given ./storj cp storj://testbucket/teset1 /tmp/ ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2018-01-04T16:55:29.832Z Name: testbucket Warning: File already exists at path [/tmp/]. Would you like to overwrite [/tmp/]: [y/n] y Unable to open /tmp/: Is a directory Example: Downloaded file name is ‘.’ ./storj cp storj://testbucket/teset1 /tmp/. ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2018-01-04T16:55:29.832Z Name: testbucket Warning: File already exists at path [/tmp/.]. Would you like to overwrite [/tmp/.]: [y/n] y Unable to open /tmp/.: Is a directory Example: Downloaded file name is ‘*’-- DONT USE THIS COMMAND. It will overwrite the first file in the directory and renames it to the downloading file name. ./storj cp storj://testbucket/http.o /tmp/* ID: 6cb2014a988adca6ed712577 Decrypted: true Created: 2018-01-04T16:55:29.832Z Name: testbucket Warning: File already exists at path [/tmp/Aac.o]. Would you like to overwrite [/tmp/Aac.o]: [y/n] y [======================================================================] 100.00% Download Success!
This reverts commit f0cfe08ba703d5f5563d20e34801e3c34cdfe120.
src/cli.c
Outdated
int ret = strpos(cmd_str, sub_str); | ||
if( ret == -1) | ||
{ | ||
printf("Invalid Command Entry (%d), \ntry ... stroj://<bucket_name>/<file_name>\n", ret); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo should be storj not stroj
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed the typo
3 things need to be fixed before merging
|
I would leave the existing commands, such as
|
src/storj.c
Outdated
storj_api->excp_cmd_resp = "get-bucket-id-resp"; | ||
|
||
/* when callback returns, we store the bucket id of bucket name else null */ | ||
return storj_bridge_get_buckets(storj_api->env, storj_api, get_bucket_id_callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be storj_bridge_get_bucket_id
, which was recently added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just happened to be a coincidence, I am open for renaming the function. For the time being I will leave there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an already existing function, see https://github.com/Storj/libstorj/blob/master/src/storj.c#L1451
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed the function name to cli-get-bucket_id()
src/cli.c
Outdated
{ | ||
struct stat sb; | ||
|
||
if (stat(file_path, &sb) == -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the style for brackets is on the same line for everything except functions, e.g.:
if (stat(file_path, &sb) == -1) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed the braces indentation as per the suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still looks like these are unchanged (bracket styles).
src/Makefile.am
Outdated
@@ -1,5 +1,5 @@ | |||
lib_LTLIBRARIES = libstorj.la | |||
libstorj_la_SOURCES = storj.c utils.c utils.h http.c http.h uploader.c uploader.h downloader.c downloader.h bip39.c bip39.h bip39_english.h crypto.c crypto.h rs.c rs.h | |||
libstorj_la_SOURCES = storj.c utils.c utils.h http.c http.h uploader.c uploader.h downloader.c downloader.h bip39.c bip39.h bip39_english.h crypto.c crypto.h rs.c rs.h storjapi_callback.c storjapi_callback.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of storjapi_callback.c
and storjapi_callback.h
it could be more clear as cli_callback.c
and cli_callback.h?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the file names from Storjapi_callback.h/c to cli_callback.h/c
Adding |
src/cli.c
Outdated
|
||
storj_api->env = env; | ||
|
||
#ifdef debug_enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a logger that can be used that will enable/disable debug based on settings (e.g. using --debug), example usage:
state->log->debug(env->log_options, NULL /*handle pointer*/, "Some debug message: %i", some_integer);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently printf's that I left in the code is used to printout error conditions. Will look into adding log->debug usage
src/storjapi_callback.h
Outdated
|
||
#include "storj.h" | ||
|
||
#define CLI_NO_SUCH_FILE_OR_DIR 0x00 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are defined twice? Once here and another in cli.c
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the duplication.
…nd file-id along with new commands that takes bucket-name and file-name
@braydonf it seems like it would be beneficial to expose the functions that take bucket/file names as well as those that take IDs; e.g. binding libraries would have to re-implement the name decryption/lookup if the new methods aren't exposed. I could imagine the solution either being to rename things to be less ambiguous or to move the new functionality to a helper module or something (i.e. not in |
…torj api call from storj.c instead of reading bucket list and doing a string compare; 3. moved the cli_api_t structure to cli_callback.h and renamed the structure to cli_api_t
@bryanchriswhite Yes, those methods have been exposed already as |
src/uploader.c
Outdated
@@ -370,7 +370,7 @@ static void after_create_bucket_entry(uv_work_t *work, int status) | |||
state->info->id = NULL; | |||
state->info->bucket_id = state->bucket_id; | |||
state->info->decrypted = true; | |||
state->info->index = strdup(state->index); | |||
state->info->index = state->index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may have been a regression, state->info->index = strdup(state->index);
is how this should be (and should go along with leaving the free to file->index in storj_free_uploaded_file_info
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made changes per the comment
src/cli_callback.h
Outdated
|
||
#include "storj.h" | ||
|
||
#if defined(_WIN32) && defined(STORJDLL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This DLL export stuff isn't needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the CLI_API references
src/cli_callback.c
Outdated
} | ||
|
||
|
||
CLI_API int cli_list_buckets(cli_api_t *cli_api) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These CLI_API are not needed here, only relevant for DLL exporting.
src/cli.c
Outdated
{ | ||
struct stat sb; | ||
|
||
if (stat(file_path, &sb) == -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still looks like these are unchanged (bracket styles).
src/cli.c
Outdated
" upload-file <bucket-id> <path>\n" \ | ||
" download-file <bucket-id> <file-id> <path>\n" \ | ||
" cp [-rR] <path-to-local-file-name> " \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grouping the unix style commands in the help text I think would be useful (example from comment at #416 (comment))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed the parenthesis and grouped the linux style commands
…grouped the linux style commands, updated the uploader file( not sure why it didnt merge when I did the fetch from upstream), but anyhow merged the changes explicitly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like most issue have been addressed! Found a couple of smaller formatting issues (easy fixes).
printf("command = %s; command_index = %d\n", command, command_index); | ||
printf("local_file_path (req arg_ = %s\n", local_file_path); | ||
for (int i = 0x00; i < argc; i++) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another {
on newline, instead of same line
char sub_str[] = "storj://"; | ||
ret = strpos(dst_path, sub_str); | ||
|
||
if( ret == 0x00) { /* Handle upload command*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small spacing issue: should be if (
instead of if(
|
||
cmd_type = UPLOAD_CMD; | ||
} | ||
else if (ret == -1) { /* Handle download command*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: newline, instead of same line
/* set the file to be downloaded */ | ||
cli_api->file_name = token[2]; | ||
|
||
if ((check_file_path(local_file_path) == CLI_VALID_DIR) || (strcmp(dst_file_name, ".") == 0x00)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potential max line length issues here?
printf("[%s][%d] Valid dst filename missing !!!!!\n", __FUNCTION__, __LINE__); | ||
goto end_program; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: } else {
instead of the newline
|
||
cli_list_mirrors(cli_api); | ||
} else | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: newline
@@ -1485,5 +1582,9 @@ int main(int argc, char **argv) | |||
if (mnemonic) { | |||
free(mnemonic); | |||
} | |||
if(cli_api){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: spacing, instead if (cli_api) {
@@ -0,0 +1,1168 @@ | |||
#include "cli_callback.h" | |||
|
|||
//#define debug_enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extraneous variable
char * start; | ||
cli_api_t *cli_api = handle; | ||
|
||
if((dp = opendir(dir)) == NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: spacing
} | ||
|
||
switch (sb.st_mode & S_IFMT) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: newline
@aligeti Also, please don't forget to take the WIP off the title when you're ready to merge. |
Went ahead and made some of the above changes already, and included in: #422 |
Thanks will take care of the indentation. Getting used to the development process. Thanks for the info on the download pause and resume feature.
…Sent from my iPhone
On Feb 14, 2018, at 17:36, Braydon Fuller ***@***.***> wrote:
@aligeti Also, please don't forget to take the WIP off the title when you're ready to merge.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Cool, it's merged so we can get more testing. FYI you can include |
Adding new commands to CLI supporting linux style