Subversion Repositories Kolibri OS

Rev

Rev 8121 | Rev 8225 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8121 Rev 8127
Line 12... Line 12...
12
*   GNU General Public License for more details.
12
*   GNU General Public License for more details.
13
*
13
*
14
*   You should have received a copy of the GNU General Public License
14
*   You should have received a copy of the GNU General Public License
15
*   along with this program.  If not, see .
15
*   along with this program.  If not, see .
16
*/
16
*/
-
 
17
 
17
/* Kolibri port by Siemargl 2018 and update by maxcodehack 2020
18
/* Kolibri port by Siemargl 2018 and update by maxcodehack 2020
18
 * my fixes mostly commented with triple comment ///
19
 * my fixes mostly commented with triple comment ///
19
 * */
20
 */
Line 20... Line 21...
20
 
21
 
Line 21... Line 22...
21
/*** Include section ***/
22
/*** Include section ***/
22
 
23
 
Line 43... Line 44...
43
///#include 
44
///#include 
44
#include 
45
#include 
45
///#include 
46
///#include 
46
#include 
47
#include 
Line -... Line 48...
-
 
48
 
-
 
49
/// Notify
Line 47... Line 50...
47
 
50
#include "notify.h"
Line 48... Line 51...
48
 
51
 
Line 1721... Line 1724...
1721
    // signal.
1724
    // signal.
1722
///    signal(SIGCONT, editorHandleSigcont);
1725
///    signal(SIGCONT, editorHandleSigcont);
1723
}
1726
}
Line 1724... Line 1727...
1724
 
1727
 
-
 
1728
void printHelp() {
1725
void printHelp() {
1729
/*	
1726
    printf("Usage: tte [OPTIONS] [FILE]\n\n");
1730
	printf("Usage: tte [OPTIONS] [FILE]\n\n");
1727
    printf("\nKEYBINDINGS\n-----------\n\n");
1731
    printf("\nKEYBINDINGS\n-----------\n\n");
1728
    printf("Keybinding\t\tAction\n\n");
1732
    printf("Keybinding\t\tAction\n\n");
1729
    printf("Ctrl-Q,^Z \t\tExit\n");
1733
    printf("Ctrl-Q,^Z \t\tExit\n");
Line 1740... Line 1744...
1740
    printf("Option        \t\tAction\n\n");
1744
    printf("Option        \t\tAction\n\n");
1741
    printf("-h | --help   \t\tPrints the help\n");
1745
    printf("-h | --help   \t\tPrints the help\n");
1742
    printf("-v | --version\t\tPrints the version of tte\n");
1746
    printf("-v | --version\t\tPrints the version of tte\n");
Line 1743... Line 1747...
1743
 
1747
 
-
 
1748
    printf("\n\nFor now, usage of ISO 8859-1 is recommended.\n");
-
 
1749
*/
-
 
1750
    
-
 
1751
    /// NOTIFY HOTKEYS 
-
 
1752
    char* __help__ = 
-
 
1753
    "'Hotkeys: \n\
-
 
1754
^Q, ^Z   Exit \n\
-
 
1755
Ctrl-S   Save \n\
-
 
1756
Ctrl-F   Search. Esc, \n\
-
 
1757
    enter and arrows to interact once searching \n\
-
 
1758
Ctrl-E   Flip line upwards \n\
-
 
1759
Ctrl-D   Flip line downwards \n\
-
 
1760
Ctrl-C   Copy line \n\
-
 
1761
Ctrl-X   Cut line \n\
-
 
1762
Ctrl-V   Paste line' -t -I";
-
 
1763
    notify(__help__);
-
 
1764
    
-
 
1765
    /// NOTIFY OPTIONS
-
 
1766
    __help__ = 
-
 
1767
    "'Options:\n\
-
 
1768
-h, --help     Prints the help \n\
-
 
1769
-v, --version  Prints the version of tte \n\
-
 
1770
For now, usage of ISO 8859-1 is recommended.\n' -t -I";
1744
    printf("\n\nFor now, usage of ISO 8859-1 is recommended.\n");
1771
	notify(__help__);
Line 1745... Line 1772...
1745
}
1772
}
1746
 
1773
 
1747
// 1 if editor should open, 0 otherwise, -1 if the program should exit
1774
// 1 if editor should open, 0 otherwise, -1 if the program should exit
Line 1752... Line 1779...
1752
    if (argc >= 2) {
1779
    if (argc >= 2) {
1753
        if (strncmp("-h", argv[1], 2) == 0 || strncmp("--help", argv[1], 6) == 0) {
1780
        if (strncmp("-h", argv[1], 2) == 0 || strncmp("--help", argv[1], 6) == 0) {
1754
            printHelp();
1781
            printHelp();
1755
            return -1;
1782
            return -1;
1756
        } else if(strncmp("-v", argv[1], 2) == 0 || strncmp("--version", argv[1], 9) == 0) {
1783
        } else if(strncmp("-v", argv[1], 2) == 0 || strncmp("--version", argv[1], 9) == 0) {
-
 
1784
            char* _notify_version = "'Version:\n";
-
 
1785
            strcat(_notify_version, TTE_VERSION);
-
 
1786
            strcat(_notify_version, "' -t -I");
1757
            printf("tte - version %s\n", TTE_VERSION);
1787
            /// printf("tte - version %s\n", TTE_VERSION);
-
 
1788
            notify(_notify_version);
1758
            return -1;
1789
            return -1;
1759
        }
1790
        }
1760
    }
1791
    }
Line 1761... Line 1792...
1761
 
1792