Skip to content

Commit

Permalink
Merge pull request #394 from geographika/rename-binaries
Browse files Browse the repository at this point in the history
feat: consolidate geostyler commands
  • Loading branch information
geographika authored Jun 20, 2024
2 parents 4b3fa57 + 4addec8 commit eacfc4c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Download the zip file for your operating system, unzip, navigate to the folder
and run the `geostyler` command:

```
geostyler --output new-qgis-style.qml my-existing.sld
geostyler-cli --output new-qgis-style.qml my-existing.sld
```

## Usage without installation ⚡
Expand All @@ -44,16 +44,16 @@ JavaScript package manager. To install the `geostyler` command globally:
npm install -g geostyler-cli
```

You can then use the new `geostyler` command, e.g.:
You can then use the new `geostyler-cli` command, e.g.:

```
geostyler -s sld -t qgis -o output.qml input.sld
geostyler-cli -s sld -t qgis -o output.qml input.sld
```

To process a folder of files:

```
geostyler -s sld -t qgis -o /outputdir /inputdir
geostyler-cli -s sld -t qgis -o /outputdir /inputdir
```


Expand All @@ -75,30 +75,30 @@ npm uninstall -g geostyler-cli
To convert a single file:

```bash
geostyler [options] -o /path/to/output.ext /path/to/input.ext
geostyler-cli [options] -o /path/to/output.ext /path/to/input.ext
# example, relying on file extensions to select the parsers
geostyler -o point_simple.sld testdata/point_simple.qml
geostyler-cli -o point_simple.sld testdata/point_simple.qml
# example with explicit parsers
geostyler -s qml -t sld -o point_simple.sld testdata/point_simple.qml
geostyler-cli -s qml -t sld -o point_simple.sld testdata/point_simple.qml
```

To convert all files in a directory:

```bash
geostyler [options] -t qgis -o /path/to/output /path/to/input/
geostyler-cli [options] -t qgis -o /path/to/output /path/to/input/
# example
geostyler -s sld -t qgis -o ./output-sld testdata/sld
geostyler-cli -s sld -t qgis -o ./output-sld testdata/sld
```

To output the GeoStyler format to `stdout` (only available for a single file), don't
set an output file or parser:

```bash
geostyler [options] /path/to/input.ext
geostyler-cli [options] /path/to/input.ext
# print the GeoStyler format to stdout (relying on the file extension to select the parser)
geostyler testdata/point_simple.qml
geostyler-cli testdata/point_simple.qml
# print an SLD output to stdout
geostyler -t sld testdata/point_simple.qml
geostyler-cli -t sld testdata/point_simple.qml
```

## Options
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"dist"
],
"bin": {
"geostyler": "dist/src/index.js",
"geostyler-cli": "dist/src/index.js"
},
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/logHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export const logHelp = () :void => {
console.log(`
Basic syntax:
npx geostyler-cli [options] [input_file | [input_directory]]
geostyler [options] [input_file | input_directory]
geostyler-cli [options] [input_file | input_directory]
Example:
npx geostyler-cli -s sld -t qgis -o output.qml [YOUR_SLD.sld]
geostyler -s qml -t mapfile -o myStyle.map testdata/point_simple.qml
geostyler -s sld -t qgis -o ./output-sld testdata/sld
geostyler-cli -s qml -t mapfile -o myStyle.map testdata/point_simple.qml
geostyler-cli -s sld -t qgis -o ./output-sld testdata/sld
Options:
-h / --help : Display this help and exit.
Expand Down

0 comments on commit eacfc4c

Please sign in to comment.