Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of a profiles feature for termshark
This work is driven by this issue: #108 Here's a description of how everything currently works. Prior to this change, termshark had one config file (per user), stored in a standard location. I'll use Linux as an example - ~/.config/termshark/termshark.toml. With this change, there's a new set of subdirectories, one per profile, containing toml files e.g. after some profiles have been created, you might have: ~/.config/termshark/profiles/classic/termshark.toml ~/.config/termshark/profiles/extracolumns/termshark.toml ~/.config/termshark/profiles/darker/termshark.toml These toml files are the same structure as the default termshark.toml. Termshark starts with the default profile, represented by the default config file (not in the new profiles/ dir). There are two new console commands: (1) :profile -> switch profile to one that exists already When a non-default profile is chosen, the settings in that profile's config file take precedence. If a setting is needed and not set explicitly, termshark falls back to the setting in the default profile. When a setting is explicitly changed, it is changed in the newly activated profile. (2) :new-profile -> create a new profile The user must choose a name that is not in use (and that can be used as a directory name). When created, termshark automatically switches to the new profile. If the profile in use at the time of creation is not the default, termshark copies the previous profile to the new profile and proceeds from there. If the profile in use is the default, the new profile will be empty. When termshark is using a non-default profile, it is shown on the top line of the UI. Termshark can be started with a non-default profile using the new -C/--profile command-line flag. Note that although I chose this to line up with Wireshark's invocation, termshark does not use Wireshark profiles in any way.
- Loading branch information