llnl / llnl/py-hostlist

command line arguments

Open
#12 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7
Forks
2
PR merge metrics
No merged PRs in 30d

Description

The original Lua hostlist has a slightly different set of command line arguments. This is taken from the help text on quartz (`hostlist -h`):

```
Usage: hostlist [OPTION]... [HOSTLIST]...

-h, --help Display this message.
-q, --quiet Quiet output (exit non-zero if empty hostlist).
-d, --delimiters=S Set output delimiter (default = ",")
-c, --count Print the number of hosts
-s, --size=N Output at most N hosts (-N for last N hosts)
-e, --expand Expand host list instead of collapsing
-n, --nth=N Output the host at index N (-N to index from end)
-u, --union Union of all HOSTLIST arguments
-m, --minus Subtract all HOSTLIST args from first HOSTLIST
-i, --intersection Intersection of all HOSTLIST args
-x, --exclude Exclude all HOSTLIST args from first HOSTLIST
-X, --xor Symmetric difference of all HOSTLIST args
-R, --remove=N Remove only N occurrences of args from HOSTLIST
-S, --sort Return sorted HOSTLIST
-f, --filter=CODE Map Lua CODE over all hosts in result HOSTLIST
-F, --find=HOST Output position of HOST in result HOSTLIST
(exits non-zero if host not found)

An arbitrary number of HOSTLIST arguments are supported for all
operations. The default operation is to concatenate all HOSTLIST args.
```

Note that capital S is sort, lowercase s is size.

We should either maintain identical commands as lua-hostlist or clearly document where py-hostlist is different.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing py-hostlist's command-line help and behavior with the lua-hostlist help text shown from quartz. Identify which options differ, then confirm whether the intended outcome is command parity or documentation of differences; done means the chosen behavior or documentation covers the listed arguments, including the lowercase and uppercase size/sort distinction.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.