Command line examples wanted.

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
pedros
Posts: 18
Joined: April 19th, 2018, 4:12 am

Command line examples wanted.

Post by pedros »

I have linux, debian 9.3, which has Battle for Wesnoth v1.12.6. I would like examples of how to use the options in terminal, which is command line.

Some of this is probably done automatically when wesnoth starts. I do it all now here, so I do not edit and corrupt the origional install. $

Code: Select all

cp -r /usr/share/games/wesnoth /home/stretch/.local/share
$

Code: Select all

man wesnoth
says to do this. It works.
$

Code: Select all

wesnoth --campaign-difficulty 1 --nosound /home/stretch/.local/share/wesnoth/1.12
Battle for Wesnoth v1.12.6
Overriding data directory with /home/stretch/.local/share/wesnoth/1.12
Data directory: /home/stretch/.local/share/wesnoth/1.12
User configuration directory: /home/stretch/.config/wesnoth
User data directory: /home/stretch/.local/share/wesnoth/1.12
Cache directory: /home/stretch/.cache/wesnoth

$

Code: Select all

man wesnoth
says to do this. It does not work.
$

Code: Select all

wesnoth --campaign Heir_To_The_Throne --campaign-difficulty 1 --nosound /home/stretch/.local/share/wesnoth/1.12
Error in command line: too many positional options have been specified on the command line

Maybe I do not understand the options. How to load a campaign in the terminal? I have another thread related to this project, Hints wanted for Wesnoth Markup Language (WML).
User avatar
Ravana
Forum Moderator
Posts: 2950
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Command line examples wanted.

Post by Ravana »

Last error suggests it does not know what to do with "/home/stretch/.local/share/wesnoth/1.12".
User avatar
octalot
General Code Maintainer
Posts: 783
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Command line examples wanted.

Post by octalot »

The campaign option seems to only accept its argument with an '='. Also you're trying to override the userdata directory, not the data directory.
wesnoth --campaign=Heir_To_The_Throne --campaign-difficulty 1 --nosound --userdata-dir ~/.local/share/wesnoth/1.12
pedros
Posts: 18
Joined: April 19th, 2018, 4:12 am

Re: Command line examples wanted.

Post by pedros »

It seems the terminal commands: man wesnoth and wesnoth -help, do not explain these well enough.
Is there better documentation? Thank you, that answers my question.
pedros
Posts: 18
Joined: April 19th, 2018, 4:12 am

Re: Command line examples wanted.

Post by pedros »

On my system, these 2 commands do the same thing.

Code: Select all

wesnoth --campaign=Heir_To_The_Throne --campaign-difficulty 1 --nosound --userdata-dir ~/.local/share/wesnoth/1.12
wesnoth --campaign=Heir_To_The_Throne --campaign-difficulty 1 --nosound --userdata-dir /home/stretch/.local/share/wesnoth/1.12
After editing some scenario files, I find that the commands open /usr/share/games/wesnoth/1.12. So as a workaround, I am using that. But how can I open ~/.local/share/wesnoth/1.12 ? Also after running the code, some directories are listed in the terminal. The list was not typed in by me. Is there documentation that describes those directories? The only documentation I could find about command line is in man wesnoth and wesnoth --help.

I tried to file a bug report, that the documentation does not include the equal sign. The page "How to report a bug properly", from the Contact Development Team, gets too involved for me. I hope someone else can test the doc, and file the report. Or at least tell me the results of the test.
User avatar
octalot
General Code Maintainer
Posts: 783
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Command line examples wanted.

Post by octalot »

The command line is processed by your command shell (probably Bash) before Wesnoth sees it. Look up "tilde expansion" in an introduction to Unix shells, or in Bash's manpage (but Bash's manpage is long and confusing).
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Command line examples wanted.

Post by Pentarctagon »

Short version:
echo /home/stretch
echo $HOME
echo ~
all should print the same thing for you.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
octalot
General Code Maintainer
Posts: 783
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Command line examples wanted.

Post by octalot »

pedros wrote: April 21st, 2018, 3:41 pmI tried to file a bug report, that the documentation does not include the equal sign. The page "How to report a bug properly", from the Contact Development Team, gets too involved for me. I hope someone else can test the doc, and file the report. Or at least tell me the results of the test.
It seems to be a regression in Boost 1.59, fixed in Boost 1.65: https://github.com/boostorg/program_options/issues/25

Which still means that it will almost certainly be a bug in any binary distribution of Wesnoth 1.14.0.
Post Reply