Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement option --display-config (Issue #100) #292

Merged
merged 4 commits into from
Dec 19, 2018
Merged

Conversation

abraunegg
Copy link
Owner

  • Implement --display-config to show the application configuration without actually performing a sync or application init

* Implement --display-config to show the application configuration without actually performing a sync or application init
@abraunegg abraunegg requested review from adudek and norbusan December 18, 2018 22:17
@abraunegg
Copy link
Owner Author

abraunegg commented Dec 18, 2018

Output when run:

./onedrive --display-config
Config path                         = /home/alex/.config/onedrive
Config file found in config path    = false
Config option 'sync_dir'            = /home/alex/OneDrive
Config option 'skip_file'           = ~*
Config option 'skip_symlinks'       = false
Config option 'monitor_interval'    = 45
Config option 'log_dir'             = /var/log/onedrive/
Selective sync configured           = false

Testing of CLI switches:

./onedrive --display-config --skip-symlinks --confdir '~/odconfig/'
Config path                         = /home/alex/odconfig/
Config file found in config path    = true
Config option 'sync_dir'            = /home/alex/OneDriveALT
Config option 'skip_file'           = ~*
Config option 'skip_symlinks'       = true
Config option 'monitor_interval'    = 90
Config option 'log_dir'             = /var/log/onedrive/
Config option 'drive_id'            = <redacted>
Selective sync configured           = false

* Update readme & manpage
@abraunegg abraunegg added this to the 2.2.2 milestone Dec 18, 2018
* Update output to include config option 'drive_id' if configured in the config file when users are attempting to sync from a sharepoint shared library
Copy link
Collaborator

@norbusan norbusan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config crash needs fixing, the rest is fine, but see my comment. Thanks for implementing this!

src/main.d Show resolved Hide resolved
src/main.d Show resolved Hide resolved
* Fix drive_id config check
Copy link
Collaborator

@norbusan norbusan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, compile and run tested here.

@abraunegg
Copy link
Owner Author

Are there any further options / config options we should print out when this flag is used?

  • no upload-only / download-only .. indicate a full bi-directional sync
  • upload validation
  • remote delete handling

Thoughts?

@norbusan
Copy link
Collaborator

Since this is an exclusive option and not pairable with --synchronize or --monitor, I think only the options configurable in the config file should be shown. All other options are set during sync/monitor run on the command line.

OTOH, it might be worth haveing onedrive --display-config ..otheroption.. --synchronize display the full set of configured stuff (config file and cmd line options) before starting the sync operation. But that can wait for another release maybe?

@abraunegg
Copy link
Owner Author

OTOH, it might be worth haveing onedrive --display-config ..otheroption.. --synchronize display the full set of configured stuff (config file and cmd line options) before starting the sync operation. But that can wait for another release maybe?

I agree - potentially beneficial when running the application as well, rather than exit & be able to use / display at the start before running. Would help with future diagnostic situations as well.

This issue (#293) also highlights another 'hidden' problem - that is, invalid 'config' options due to spelling or otherwise.

Potentially need to add in to always check the 'config' file if present to ensure that all options that are contained within the file are:

  • spelt correctly
  • valid options by name or otherwise

Copy link

@adudek adudek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be even better solution to parse config into JSON format, and give ability to use this output as config source for "semi-automatic" setup with --use-config='file.json'
It then could be used as debug data file (when submitting issue) and would be easy to validate with JSON schema

@norbusan
Copy link
Collaborator

I sent a pull request concerning the validation of config file, and I will look into the JSON stuff. Let us discuss this in a different issue.

@abraunegg abraunegg merged commit 7d52258 into master Dec 19, 2018
@abraunegg abraunegg deleted the Issue-#100 branch December 19, 2018 18:42
@lock
Copy link

lock bot commented Jan 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Jan 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants