Skip to content

Commandline options do not work in Windows #1069

Closed

Description

@kaislahattu

Details for the issue

Version: 3.10.0 Beta1
OS: Win10 Home 1703

Application binary does not seem react to commandline options (using command prompt) in "expected" ways. For example, invoking the application with "--help" does not yield the expected help (as seen in the Application.cpp) into the command prompt. Issuing '-s' option without SQL does not seem to complain about the missing SQL (application merely starts normally).

Currently (today) I am unable to test Linux version for same behaviour.

Useful extra information

I'm opening this issue because:

  • DB4S is crashing
  • DB4S has a bug
  • DB4S needs a feature
  • DB4S has another problem

I'm using DB4S on:

  • Windows: ( version: Win10 )
  • Linux: ( distro: Debian )
  • Mac OS: ( version: ___ )
  • Other: ___

I'm using DB4S version:

  • 3.10.0 Beta 1
  • 3.9.1
  • 3.9.0
  • Other: ___

I have also:

Activity

  1. karim commented on Jul 31, 2017

    @karim
    Member

    Version 3.9.1 is very old. Can you try to use our latest nightly build (https://nightlies.sqlitebrowser.org/latest/) or version 3.10.0 (currently in beta testing) from the releases section (https://github.com/sqlitebrowser/sqlitebrowser/releases) and see if the issue is fixed with any of them.

  2. kaislahattu commented on Jul 31, 2017

    @kaislahattu
    Author

    3.10.0 beta1 win64 DOES open the specified datafile, which addresses the main concern (for me). However, '--help' still does nothing, although some kind of a window flashes really quick before disappearing. '-s' seem to open the application just as if it were started normally without commanline options (does not complain about missing SQL or such...).

    To me it seems as if the Windows commandline options are still not working entirely as intended - but that the databasefile can now be added into a shortcut is a major convenience for me - I'll be using this version from now on.

  3. justinclift commented on Jul 31, 2017

    @justinclift
    Member

    Ahhh, are you running the commands from a batch file, or from the command line?

    Asking because the --help option is pretty much targeted at people running it from the command line. In theory if you run it from there, it should display the list of known command line options and what they're for.

    If it's not doing that for you though, then it's probably a bug. 😉

  4. kaislahattu commented on Jul 31, 2017

    @kaislahattu
    Author

    I have a command prompt open and I am typing these ..."tests" in there (not using a batch file). I'm a happy camper now regardless - I can have my shortcuts for each datafile :)

  5. justinclift commented on Jul 31, 2017

    @justinclift
    Member

    Cool. 😄

  6. kaislahattu commented on Jul 31, 2017

    @kaislahattu
    Author

    Question: Since this ticket mentions an old version, should this be closed and new created for new version (in which '--help' does not produce expected command prompt output)? ...or can this be updated? (my github fluency is remarkably non-existent)

  7. justinclift commented on Jul 31, 2017

    @justinclift
    Member

    In theory, you should be able to edit the comments and issues you've created. On the top right of any of the comments, and the original description, there should be a clickable little pencil icon which makes it go into edit mode. Give that a shot. 😄

  8. justinclift commented on Jul 31, 2017

    @justinclift
    Member

    As a reference data point, this is what --help shows on the command line for me on OSX with our very latest source code:

    $ src/DB\ Browser\ for\ SQLite.app/Contents/MacOS/DB\ Browser\ for\ SQLite --help
    Usage: src/DB Browser for SQLite.app/Contents/MacOS/DB Browser for SQLite [options] [db]
    
    Possible command line arguments:
      -h, --help		Show command line options
      -q, --quit		Exit application after running scripts
      -s, --sql [file]	Execute this SQL file after opening the DB
      -t, --table [table]	Browse this table after opening the DB
      -v, --version		Display the current version
      [file]		Open this SQLite database
    

    The long name needed to launch the app is just a side effect of how it's compiled on OSX. On Linux it should still be sqlitebrowser, so is easier to launch. 😉

  9. kaislahattu commented on Jul 31, 2017

    @kaislahattu
    Author

    My Windows prompt looks like this:

    C:\Program Files\DB Browser for SQLite>"DB Browser for SQLite.exe" -v

    C:\Program Files\DB Browser for SQLite>"DB Browser for SQLite.exe" --help

    C:\Program Files\DB Browser for SQLite>"DB Browser for SQLite.exe" --please_say_something

    C:\Program Files\DB Browser for SQLite>

  10. justinclift commented on Jul 31, 2017

    @justinclift
    Member

    Interesting. I'll try it out on a Windows VM in a bit, and see if the same thing happens to me (eg verify the problem).

    It's possible our code to output the options is being skipped on Windows for some reason.

  11. chrisjlocke commented on Jul 31, 2017

    @chrisjlocke
    Member

    Also note that if you do put gibberish, DB4S doesn't moan. So db browser for sqlite.exe "mary had a little lamb.db" only opens a 'clean' DB4S window - it doesn't report that that file doesn't exist, or the command option was invalid.
    Specifiying a valid filename does work.

    This is kinda linked to the other issue when Martin added debug code to DB4S but the Windows version wasn't outputting it. Its as if DB4S is trying to display text to the console, but there is no 'console' to output it to.
    This kind of makes sense, as the command prompt fires off DB4S and then hands control back to the user. It doesn't keep a 'connection' open for output to be displayed back. Maybe 'if operating_system = "windows" then display_messagebox else display_to_console...'

  12. justinclift commented on Jul 31, 2017

    @justinclift
    Member

    Just tried this out on the Windows build VM, with our latest nightly build.

    @kaislahattu is definitely correct. No options get printed out, and a light coloured application window (main DB4S window maybe?) is displayed on the screen for a fraction of a second. Not enough to recognise what it was, though maybe screencasting software would be able to grab a good look at it (can't be bothered atm though). 😉

    @chrisjlocke Yeah, it could be something like that. We're using qWarning() to display stuff to the console... maybe it needs special treatment to get things showing correctly on Windows. 😄

  13. justinclift commented on Jul 31, 2017

    @justinclift
    Member

    @kaislahattu I've just added 3.10.0-beta1 to our project issue template, to make things slightly easier for future issue reporters too. 😄

  14. chrisjlocke commented on Jul 31, 2017

    @chrisjlocke
    Member

    though maybe screencasting software would be able to grab a good look at it

    Or recording it on a smartphone? Just something we've done sometimes... (especially on BIOS errors at boot up .... crap, was it F9 for boot menu, or F12, or delete...)

    and a light coloured application window (main DB4S window maybe?) is displayed on the screen for a fraction of a second.

    If I run DB4S at a command prompt with the -h or --help options, DB4S just starts as normal.

  15. 39 remaining items

  16. mgrojo commented on Sep 2, 2020

    @mgrojo
    Member

    It should be fixed in next nightly build. Sorry, I didn't take enough attention to the last change 😄

  17. chrisjlocke commented on Sep 3, 2020

    @chrisjlocke
    Member

    Can confirm works well! 👍

    image

  18. justinclift commented on Sep 3, 2020

    @justinclift
    Member

    Looks good. 😄

  19. Jasata commented on Sep 3, 2020

    @Jasata

    Works well and looks good doing it. -v dialog seems to also have been added with a little bit new information, which is always nice.

    Thank you again for everyone giving this issue time and fixing it. 👍

  20. added this to the 3.12.1 milestone on Sep 13, 2020
  21. Master-s commented on Aug 23, 2024

    @Master-s

    DB Browser for SQLite.exe
    I want the code for exporting csv and importing it to a database

  22. chrisjlocke commented on Aug 23, 2024

    @chrisjlocke
    Member

    Ideally, you should raise a new issue, as your issue is nothing to do with commandline options not working.
    Also, you need to explain what you are exporting the csv from .. how can anyone explain how to export a csv if you haven't explained what program you're using? Excel? Another database? Wind Farm Simulator 3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions