This is a simple cli which prepends 42 header (from 42 school) to your desired file. Required arguments are as follows:
- name: your 42 identifier
- email: your 42 email
- path: path to your desired file
Generated output is like this:
This program is actually built to be used as a Zed Task. Let me tell you how.
1. download cli from release page.
2. edit a Zed Task file (such as ~/.config/zed/tasks.json
) like this:
[
{
"label": "...",
"command": "...",
"args": ["...", ...]
}
]
3. Press Alt + Shift + T to spawn task. your task should be right there.
However, I'm happy to tell you that this executable now works with norminette LSP for Zed! This means if you do some config, then when you save file, Norminette extension will automatically update your 42 header! now you have to do:
- download executable from release page.
- install "Norminette" extension in Zed.
- in your Zed's
settings.json
, create or add like following, to the"lsp"
:
"lsp": {
...
"c-norminette": {
"initialization_options": {
"path": "/path/to/inject_42h",
"name": "<42 Intra ID>",
"email": "<42 Intra Email>",
"offset": 9 // timezone offset to UTC. positive for +, negative for -
}
},
...
}
- enjoy!
the extension will download and execute the LSP for Norminette, and when you save the file, the 42 header will be created or updated automatically!