You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Running lnav -i <file> to install log definitions will clobber an existing ones. Generally this is preferred but when sharing definitions to other users (in a team setting) who edit the "base format" to add their own customizations may inadvertently lose them.
Context: This is usually user error but adding a small quality of life improvement to prevent destructive format installs would be a nice addition. A contrived but plausible scenario is running lnav -i $XDG_CONFIG_HOME/lnav/formats/installed foo.json will yield a 0 length file.
Describe the solution you'd like
Prompt the user that an format definition already exists and give them a chance to bail/overwrite. It should print out the absolute path so it's fast to backup/edit.
Note: I'm not sure how this would adversely impact lnav -i extras since that might be expected (as an update). But that's extra work that's probably not needed.
Describe alternatives you've considered
Workaround using a bootstrapping script
lnav_format="$(lnav -m format my_json_log source2> /dev/null)"if [ -n"$lnav_format" ];then
confirm="n"echo"warning: my_json_log format already exists '$lnav_format'"read -r -p "overwrite? [y/n] " confirm
if [[ "$confirm"=~ [NnQq] ]];thenexit 0
fifi
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Running
lnav -i <file>
to install log definitions will clobber an existing ones. Generally this is preferred but when sharing definitions to other users (in a team setting) who edit the "base format" to add their own customizations may inadvertently lose them.Context: This is usually user error but adding a small quality of life improvement to prevent destructive format installs would be a nice addition. A contrived but plausible scenario is running
lnav -i $XDG_CONFIG_HOME/lnav/formats/installed foo.json
will yield a 0 length file.Describe the solution you'd like
Prompt the user that an format definition already exists and give them a chance to bail/overwrite. It should print out the absolute path so it's fast to backup/edit.
Note: I'm not sure how this would adversely impact
lnav -i extras
since that might be expected (as an update). But that's extra work that's probably not needed.Describe alternatives you've considered
Workaround using a bootstrapping script
The text was updated successfully, but these errors were encountered: