help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sh scripts and yasnippet


From: Andrea Crotti
Subject: Sh scripts and yasnippet
Date: Thu, 12 Aug 2010 13:03:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin)

I just got an idea that could maybe make life easier to sysadmins.

Given a script like

--8<---------------cut here---------------start------------->8---
#!/bin/sh
DST=$1
SRC=$2

cp -R $DST $SRC
--8<---------------cut here---------------end--------------->8---


Sometimes it's hard to remember what are the arguments without looking
into the code or read the usage.
And more important maybe the script does something which now is wrong,
so it would be better to check first.

What if we could have something like

- script to snippet
- snippet expansion
- open a confirmation buffer with the values expanded and run

would it not be great?
It could work for any language script, but we have to know how
substitutions are done, and it could be not always trivial (shift in sh
scripts for example).

Anyone interested?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]