Accessing Available Indexes
- Vorherrschende Sprache
- Python
- Sterne
- 28.2k
- Forks
- 1.5k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I have a project [pyattck](https://github.com/swimlane/pyattck) that is utilizing fire for it's command line interface and I am returning a list of objects.
For example, when using pyattck you can access all techniques from the Enterprise MITRE ATT&CK Framework like so:
```python
from pyattck import Attck
attack = Attck()
for technique in attack.enterprise.techniques:
print(technique.id)
print(technique.name)
# etc.
```
When using fire, I can access the same data using:
```
pyattck enterprise techniques 4 id
pyattck enterprise techniques 4 name
# etc.
```
My question is, how can I specify a range or to print out ALL technique `id` or `name` or `etc` properties using fire?
Ideally I would want to access the `INDEXES` range by either specifying the range of `0..265` or having a `foreach` clause.
Is this possible or is there another way of handling this?
Here is an example of calling it without specifying the range number of `1` or `4` or `164` etc.
```
josh.rickard@Joshs-MacBook-Pro ~ % pyattck enterprise techniques name
ERROR: Unable to index into component with argument: name
Usage: pyattck enterprise techniques
available commands: append | clear | copy | count | extend | index |
insert | pop | remove | reverse | sort
available indexes: 0..265
For detailed information on this command, run:
pyattck enterprise techniques --help
```
tldr: How do you access the indexes or how do you properly deal with indexes in fire?
Beitragsleitfaden
Rechercherichtung
Beginne damit, den Befehl `pyattck enterprise techniques name` zu reproduzieren, und vergleiche ihn mit indizierten Aufrufen wie `pyattck enterprise techniques 4 name`. Lies die CLI-Hilfeausgabe und ermittle, ob der Zugriff über Bereiche oder foreach unterstützt wird; dokumentiere das unterstützte Verhalten oder definiere die erforderliche Änderung und deren Abschlusskriterien.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- cli
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100