Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

subpath parameter in command line not working #1552

Open
Kimuji opened this issue Apr 22, 2017 · 5 comments
Open

subpath parameter in command line not working #1552

Kimuji opened this issue Apr 22, 2017 · 5 comments

Comments

@Kimuji
Copy link

Kimuji commented Apr 22, 2017

Expected Behavior:

Launching with subpath parameter should make the programe to look for config files in subpath/

Actual Behavior:

Program not starting

Your config.json:

Try to start with : Necrobot2.exe -subpath config1

(OPTIONAL) Your Log:

conflict error with -s option

NecroBot-Private for Pokémon GO $(APPVEYOR_REPO_TAG_NAME)
Copyright NecroBot-Private Team © 2017

ERROR(S):
-s/--start option violates format.

@Kimuji Kimuji changed the title subpath command line not working subpath parameter in command line not working Apr 22, 2017
@CDAGaming
Copy link
Contributor

Looked into code, and it seems almost everywhere it's just config/config.json, might change this later though for this

@Kimuji
Copy link
Author

Kimuji commented Apr 22, 2017

i tried to look at the source code, and it's supposed to concat current directory with the subpath parameter and look for config folder in that folder
PoGo.NecroBot.CLI/Program.cs:
...
_subPath = commandLine["subpath"];
...
var profilePath = Path.Combine(Directory.GetCurrentDirectory(), _subPath);
var profileConfigPath = Path.Combine(profilePath, "config");
var configFile = Path.Combine(profileConfigPath, "config.json");

@Kimuji
Copy link
Author

Kimuji commented Apr 22, 2017

i think it's a conflict between

class Options
{
   [Option('s', "start", DefaultValue = 1,HelpText = "Start account", Required = false)]

and

        var commandLine = new Arguments(args);
        // Look for specific arguments values
        if (commandLine["subpath"] != null && commandLine["subpath"].Length > 0)
        {
            _subPath = commandLine["subpath"];
        }

the -subpath parameter is interpreted as -s/--start option

@hardknoxni69a
Copy link
Contributor

you have to change your directory to the location of the necrobot2.exe before executing your start command or it will look for config folder whereever your executing the command from

@Kimuji
Copy link
Author

Kimuji commented Apr 27, 2017

already doing that, the error seems pretty explicit:

C:\NecroBot2.Console>Necrobot2.exe -subpath config1
[23:02:14] () Configuration is up-to-date. Schema version: 23
[23:02:14] () Validating config.json...
[23:02:15] () Auth Configuration is up-to-date. Schema version: 23
[23:02:15] () Validating Auth.json...
NecroBot-Private for Pokémon GO $(APPVEYOR_REPO_TAG_NAME)
Copyright NecroBot-Private Team © 2017

ERROR(S):
-s/--start option violates format.

-i, --init Init account
-t, --template (Default: ) Prints all messages to standard output.
-p, --password (Default: ) pasword
-g, --google (Default: False) is google account
-s, --start (Default: 1) Start account
-e, --end (Default: 10) End account
--help Display this help screen.

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

No branches or pull requests

3 participants