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

Feature request: Command Line Options #53

Open
hkramski opened this issue Nov 26, 2019 · 5 comments
Open

Feature request: Command Line Options #53

hkramski opened this issue Nov 26, 2019 · 5 comments

Comments

@hkramski
Copy link

I would like to have a cmd line option to provide the database password (or a file containing the password) and another option to start openMittsu in (auto-)connected mode. Maybe also the database path as a parameter.

If cmd line options were introduced, there should also be a --help handler.

TIA
Heinz

@blizzard4591
Copy link
Owner

This was implemented two commits ago, sorry for not responding earlier. There should be output from --help, and the current options are:

  • --openmittsu-nopassword
  • --openmittsu-password-file
  • --openmittsu-database-file
  • --openmittsu-autoconnect
  • --openmittsu-minimize

I hope this helps :)

@hkramski
Copy link
Author

Hi, thanks a lot, great work!
However. I can't get --openmittsu-password-file to work - tried every combination of nothing / cr / lf / crlf and file encoding I could think of. Which exact format is expected for a password?

Regards,
Heinz

@blizzard4591
Copy link
Owner

The entire file is read at once and used as the password, so a file containing just the password in UTF-8 or similar, no Byte-Order Mark, should work (I tried it using Notepad, New File, enter the password, save).

Of course, things like BOMs should not break everything, I hope to revisit this quick and dirty implementation soon.

@blizzard4591
Copy link
Owner

Should be fixed with commit 9d988ea.
Please test whether it works now :)

@hkramski
Copy link
Author

I'm now at r352.9d988ea-1 but my issue still exists.

I think the problem is not a BOM but an additional linefeed (0x0a) at the end of the password line. In contrast to notepad++ on Windows, all Linux editors (tried Vim, Emacs, Kate) seem to add one even if you do not press Enter after entering your password, and echo "pw" > pw.txt also adds a linefeed character. As a workaround, you can use echo -n "pw" > pw.txt , which gets you a working password file. I can happily live with that workaround, but perhaps reading up to and not including any carriage returns or linefeeds is a more robust solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants