Difference between revisions of "Simple Garage"

From Stunts Wiki
Line 4: Line 4:
 
Simple Garage operates by managing two directories: Stunts directory and a garage directory. When run, it looks for a configuration file called ''sgar.cfg'', where each line contains a configuration item, followed by an equals sign and its value. The following configuration items can be found:
 
Simple Garage operates by managing two directories: Stunts directory and a garage directory. When run, it looks for a configuration file called ''sgar.cfg'', where each line contains a configuration item, followed by an equals sign and its value. The following configuration items can be found:
  
* stunts - ''The directory where Stunts can be found''
+
* '''stunts''' - The directory where Stunts can be found
* garage - ''The directory that will be used for parking cars (putting away from Stunts)''
+
* '''garage''' - The directory that will be used for parking cars (putting away from Stunts)
* locked - ''A list of car IDs separated by commas that should not be moved''
+
* '''locked''' - A list of car IDs separated by commas that should not be moved
* group - ''A list of car IDs preceded by a group name followed by a colon. There can be many groups''
+
* '''group''' - A list of car IDs preceded by a group name followed by a colon. There can be many groups
  
 
For Simple Garage to work, all you need is to specify the two directories. The rest can be set up within the program environment. Commands can be used to list cars and move them back and forth between Stunts and the garage, creating and deleting groups, assigning cars to them, etc.
 
For Simple Garage to work, all you need is to specify the two directories. The rest can be set up within the program environment. Commands can be used to list cars and move them back and forth between Stunts and the garage, creating and deleting groups, assigning cars to them, etc.

Revision as of 05:23, 9 June 2022

Simple Garage, also known as sgar for its command line program file name, is a garage managing tool created by Cas. It has the particular characteristic of being command line based. Simple Garage features its own command line interpreter, but can also be called to perform individual commands, opening the door for external scripting. It can run in GNU/Linux as well as in DOS and Windows.

Configuration

Simple Garage operates by managing two directories: Stunts directory and a garage directory. When run, it looks for a configuration file called sgar.cfg, where each line contains a configuration item, followed by an equals sign and its value. The following configuration items can be found:

  • stunts - The directory where Stunts can be found
  • garage - The directory that will be used for parking cars (putting away from Stunts)
  • locked - A list of car IDs separated by commas that should not be moved
  • group - A list of car IDs preceded by a group name followed by a colon. There can be many groups

For Simple Garage to work, all you need is to specify the two directories. The rest can be set up within the program environment. Commands can be used to list cars and move them back and forth between Stunts and the garage, creating and deleting groups, assigning cars to them, etc.

Calling commands

Commands consist of a command name and often one or more parameters, separated by spaces. Where a parameter represents a car, it can also be a group of cars. Actual groups are specified with an identifier preceeded by a pound sign (#), whereas ad-hoc groups can be issued by giving a list of car IDs separated by commas. In place of any car ID, a filter can be used, that is, a part of the car name. Following is a list of the commands available in Simple Garage:

  • addto <group> <car(s)> - Adds cars to a group
  • bring <car(s)> - Brings cars out of the garage and to Stunts
  • car <car ID> - Retrieves information about a specific car
  • cars - Returns the count of cars in Stunts and the garage
  • delgroup <group> - Deletes a group
  • dirs - Outputs the currently set Stunts and garage directory paths
  • exit - Exits the command line interface
  • groups - Lists all groups
  • groupthese <group> - Creates a group out of the cars currently in Stunts
  • gs - Short for groups
  • gt <group> - Short for groupthese
  • help [filters] - Shows help
  • l <car(s)> - Short for list
  • lg <car(s)> - Lists cars in the garage
  • list <car(s)> - Lists all cars both in Stunts and the garage
  • lock <car ID> - Locks a car so that it won't move when other commands are executed
  • locked - Lists currently locked cars
  • lp <car(s)> - Stands for "list parked", same as lg
  • ls <car(s)> - Lists cars in Stunts
  • only <group> - Brings every car in the given group to Stunts and moves every other to the garage
  • park <car(s)> - Moves cars to the garage
  • quit - Same as exit
  • removefrom <group> <car(s)> - Removes cars from a group
  • retrieve <car(s)> - Same as bring
  • rf <group> <car(s)> - Short for removefrom
  • rmgroup <group> - Same as delgroup
  • unlock <car ID> - Unlocks a car so that it can be freely moved by other commands
  • version - Displays the current program version

So for example, you could create a group of fast cars by using filters by running addto fast pmin,jagu,p962,Melange. Notice how you can use both car IDs and parts of the car names. You can also specify if it's the beginning or end of the name you're filtering, such as for creating a group of all Porsche cars: addto Porsche Porsche*. If you consider that all Porsche cars are fast, you may want to add them all to the "fast" group: addto fast #Porsche. A group is automatically created when you add the first car and automatically removed when you delete the last one. A word preceded by a pound sign will be understood as an actual group; otherwise, if it's four characters long, it'll be assumed to be a car ID. In any other case, it will be taken for a filter. A filter without an asterisk is the same as if it had astersisks at both ends, that is, March will target the Porsch March Indy, just like *March* would. Please note that filtering is case insensitive. Filters and car lists can be combined. Thus, ls fgto,#Porsche,Lambo will list the Ferrari GTO, all cars in the Porsche group and all Lamborghinis as long as they're currently in Stunts (not in the garage).