/[git-send]/git-send-paste
ViewVC logotype

Annotation of /git-send-paste

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations)
Mon Sep 30 00:56:08 2024 UTC (6 weeks, 4 days ago) by nishi
Branch: MAIN
CVS Tags: HEAD
moving files

1 nishi 1.1 #!/bin/sh
2     # $TheSupernovaDuo: git-send-paste,v 0.1.0 2023/5/27 23:35:57 yakumo_izuru Exp $
3     #
4     # Send git patches to a pastebin endpoint using nc(1)
5     # https://git.kyoko-project.wer.ee/koizumi.aoi/git-crap
6    
7     usage() {
8     printf "Usage: %s --diff=<diff> --paste=<paste>\n" "${0##/*}"
9     }
10    
11     for arg; do
12     case $arg in
13     -h) usage ;;
14     --diff=*) diff=${arg#*=} ;;
15     --paste=*) paste=${arg#*=} ;;
16     *-*) printf "Unknown option: %s\n" "$arg" ;;
17     *=*) export "${arg:?}" ;;
18     *) printf "Unknown argument: %s\n" "$arg" ;;
19     esac
20     done
21    
22     if [ -z $diff && -z $paste ]; then
23     usage
24     exit 1
25     else
26     printf "Sending patch file %s to endpoint %s\n" "${diff}" "${paste}"
27     cat $diff | nc $paste 9999
28     fi

nishi@chaotic.ninja
ViewVC Help
Powered by ViewVC 1.3.0-dev